github react-navigation/react-navigation @react-navigation/routers@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

  • default to backBehavior: firstRoute for TabRouter (8bdc6c6)
  • don't merge params on navigation (366d018)
  • fix getId being called for incorrect routes. closes #9343 (61e653d)
  • fix StackRouter incorrectly handling invalid route if key is present (3367ddf)

Code Refactoring

  • don't use a boolean for drawer status (cda6397)

Features

  • add a new backBehavior: firstRoute for TabRouter (7c1cd26)
  • add a way to specify an unique ID for screens (15b8bb3)
  • add pressColor and pressOpacity props to drawerItem (#8834) (52dbe4b)
  • associate path with the route it opens when deep linking (#9384) (86e64fd), closes #9102

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
  • Returning to first route after pressing back seems more common in apps. This commit changes the default for tab and drawer navigators to follow this common practice. To preserve previous behavior, you can pass backBehavior=history to tab and drawer navigators.
  • Previous versions of React Navigation merged params on navigation which caused confusion. This commit changes params not to be merged.

The old behaviour can still be achieved by passing merge: true explicitly:

CommonActions.navigate({
  name: 'bar',
  params: { fruit: 'orange' },
  merge: true,
})

initialParams specified for the screen are always merged.

Don't miss a new react-navigation release

NewReleases is sending notifications on new releases.