github react-navigation/react-navigation @react-navigation/drawer@6.0.0-next.0

latest releases: @react-navigation/stack@7.0.0-alpha.20, @react-navigation/native-stack@7.0.0-alpha.20, @react-navigation/material-top-tabs@7.0.0-alpha.19...
pre-release3 years ago

6.0.0-next.0 (2021-03-09)

Bug Fixes

  • add missing helper types in descriptors (21a1154)
  • drop usage of Dimensions in favor of metrics from safe-area-context (12b893d)
  • enable detachInactiveScreens by default on web for better a11y (4954d6a)
  • fix drawer and bottom tabs not being visible on web. closes #9225 (b735de1)
  • fix drawer screen content not being interactable on Android (865d8b3)
  • fix initial metrics on server (69d333f)
  • fix pointerEvents in ResourceSavingScene (af53dd6), closes #9241 #9242
  • fix typo for default prop in drawer (b376e9c)

Code Refactoring

  • don't use a boolean for drawer status (cda6397)
  • don't use absolute position for header (79a85a4)
  • don't use deprecated APIs from react-native-safe-area-context (ddf27bf)
  • drop drawerOpen and drawerClose events (5648e1a)
  • move drawerContentOptions to options (15e5678)
  • simplify props for stack and drawer headers (4cad132)

Features

  • add pressColor and pressOpacity props to drawerItem (#8834) (52dbe4b)
  • initial implementation of @react-navigation/elements (07ba7a9)
  • move lazy to options for bottom-tabs and drawer (068a9a4)

BREAKING CHANGES

  • Drawer status is now a union ('open', 'closed') instead of a boolean. This will let us implement more types of status in future.

Following this the following exports have been renamed as well:

  • getIsDrawerOpenFromState -> getDrawerStatusFromState
  • useIsDrawerOpen -> useDrawerStatus
  • We now use flexbox for header elements which could break some existing style code which relied on absolute positioning.
  • The lazy prop now can be configured per screen instead of for the whole navigator. To keep previous behavior, you can specify it in screenOptions
  • This commit moves options from drawerContentOptions to regular options in order to reduce confusion between the two, as well as to make it more flexible to configure the drawer on a per screen basis.
  • We now require newer versions of safe area context library.
  • drawer's status can be queried through the isDrawerOpen hook. no need for the events
  • Previously, the stack header accepted scene and previous scene which contained things such as descriptor, navigation prop, progress etc. The commit simplifies them to pass route, navigation, options and progress directly to the header. Similaryly, the previous argument now contains options, route and progress.

Don't miss a new react-navigation release

NewReleases is sending notifications on new releases.