All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
7.0.0-rc.8 (2024-08-07)
- improve how navigate and other methods are typed (#12093) (a528b9b) - by @satya164
- match push and jumpTo types to navigate (23d9f2e) - by @satya164
7.0.0-rc.7 (2024-08-01)
Note: Version bump only for package @react-navigation/routers
7.0.0-rc.6 (2024-07-11)
- upgrade react-native-builder-bob (1575287) - by @
7.0.0-rc.5 (2024-07-07)
Note: Version bump only for package @react-navigation/routers
7.0.0-rc.4 (2024-07-04)
- fix published files (829caa0) - by @
7.0.0-rc.3 (2024-07-04)
Note: Version bump only for package @react-navigation/routers
7.0.0-rc.2 (2024-07-04)
- add package.json exports field (1435cfe) - by @
7.0.0-rc.1 (2024-07-01)
- stop using react-native field in package.json (efc33cb) - by @
7.0.0-rc.0 (2024-06-27)
7.0.0-alpha.6 (2024-02-23)
Note: Version bump only for package @react-navigation/routers
7.0.0-alpha.5 (2024-01-17)
- add retaining of the screen to the stack navigator (#11765) (7fe82f7), closes #11758 - by @osdnk
- preloading in routers (382d6e6) - by @osdnk
7.0.0-alpha.4 (2023-11-17)
Note: Version bump only for package @react-navigation/routers
7.0.0-alpha.3 (2023-11-12)
Note: Version bump only for package @react-navigation/routers
7.0.0-alpha.2 (2023-09-07)
Note: Version bump only for package @react-navigation/routers
7.0.0-alpha.1 (2023-03-01)
- fix paths in sourcemap files (368e069) - by @satya164
- handle getId in tab and drawer routers (7430c72) - by @satya164
7.0.0-alpha.0 (2023-02-17)
-
handle merge: true with NAVIGATION_DEPRECATED in TabRouter (e5cf73d) - by @satya164
-
feat!: add
popTo
method for stack and remove going back behaviour of (c9c2163) - by @satya164 -
refactor!: drop support for key property in navigate (61c53bb) - by @satya164
- add navigateDeprecated for backward compatibility (8ea6dc7) - by @satya164
- extract drawer to a separate package (58b7cae) - by @satya164
- Previously,
navigate
method navigated back if the screen already exists in the stack. I have seen many people get confused by this behavior. This behavior is also used for sending params to a previous screen in the documentation. However, it's also problematic since it could either push or pop the screens based on the scenario.
This removes the going back behavior from navigate
and adds a new method
popTo
to go back to a specific screen in the stack.
The methods now behave as follows:
navigate(screenName)
will stay on the current screen if the screen is already focused, otherwise push a new screen to the stack.popTo(screenName)
will go back to the screen if it exists in the stack, otherwise pop the current screen and add this screen to the stack.- To achieve the previous behavior with
navigate
, you can use thegetId
prop in which case it'll go to the screen with the matching ID and push or pop screens accordingly.
- Previously, you could specify a route
key
to navigate to, e.g.navigation.navigate({ key: 'someuniquekey' })
. It's problematic sincekey
is an internal implementation detail and created by the library internally - which makes it weird to use. None of the other actions support such usage either.
In addition, we have already added a better API (getId
) which can be used for similar use
cases - and gives users full control since they provide the ID and it's not autogenerated by the
library.
So this change removes the key
option from the navigate
action.
6.1.3 (2022-09-16)
Note: Version bump only for package @react-navigation/routers
6.1.2 (2022-08-24)
Note: Version bump only for package @react-navigation/routers
6.1.1 (2022-07-05)
Note: Version bump only for package @react-navigation/routers
6.1.0 (2021-10-12)
- add a
navigationKey
prop to Screen and Group (b2fa62c)
6.0.2 (2021-10-09)
- properly handle history if drawer is open by default (de2d4e4)
6.0.1 (2021-08-03)
- Revert "fix: don't merge initial params when merge !== true" (8086772)
6.0.0 (2021-08-01)
- don't merge initial params when merge !== true (54b215b)
6.0.0-next.6 (2021-07-01)
Note: Version bump only for package @react-navigation/routers
6.0.0-next.5 (2021-06-10)
Note: Version bump only for package @react-navigation/routers
6.0.0-next.4 (2021-05-27)
Note: Version bump only for package @react-navigation/routers
6.0.0-next.3 (2021-05-23)
Note: Version bump only for package @react-navigation/routers
6.0.0-next.2 (2021-04-08)
Note: Version bump only for package @react-navigation/routers
6.0.0-next.1 (2021-03-10)
Note: Version bump only for package @react-navigation/routers
6.0.0-next.0 (2021-03-09)
- 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)
- don't use a boolean for drawer status (cda6397)
- 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
- 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.
5.6.2 (2020-11-09)
Note: Version bump only for package @react-navigation/routers
5.6.1 (2020-11-08)
Note: Version bump only for package @react-navigation/routers
5.6.0 (2020-11-04)
- add a merge option to navigate to control merging params (9beca3a)
5.5.1 (2020-10-28)
- improve types for route prop in screenOptions (d26bcc0)
5.5.0 (2020-10-24)
- handle pushing a route with duplicate key (091b2a2)
- allow deep linking to reset state (#8973) (7f3b27a), closes #8952
- improve types for navigation state (#8980) (7dc2f58)
5.4.12 (2020-09-22)
Note: Version bump only for package @react-navigation/routers
5.4.11 (2020-08-04)
Note: Version bump only for package @react-navigation/routers
5.4.10 (2020-07-28)
- make sure history is correct after rehydration (b70e3fe)
- make sure index is correct when rehydrating state for tabs (#8638) (1aa8219)
5.4.9 (2020-07-10)
- mark some types as read-only (7c3a0a0)
- only remove non-existed routes from tab history. closes #8567 (374b081)
5.4.8 (2020-06-24)
- more improvements to types (d244488)
5.4.7 (2020-05-23)
Note: Version bump only for package @react-navigation/routers
5.4.6 (2020-05-20)
Note: Version bump only for package @react-navigation/routers
5.4.5 (2020-05-20)
Note: Version bump only for package @react-navigation/routers
5.4.4 (2020-05-08)
5.4.3 (2020-05-08)
Note: Version bump only for package @react-navigation/routers
5.4.2 (2020-04-30)
5.4.1 (2020-04-27)
- fix behaviour of openByDefault in drawer when focus changes (b172b51)
5.4.0 (2020-04-17)
- add openByDefault option to drawer (36689e2)
5.3.0 (2020-04-08)
- separate normal exports and type exports (303f0b7)
- make replace bubble up (ba1f405)
5.2.1 (2020-03-30)
Note: Version bump only for package @react-navigation/routers
5.2.0 (2020-03-22)
- add keys to routes missing keys during reset (813a590)
5.1.1 (2020-03-16)
- don't handle action if no routes are present (660cac3)
5.1.0 (2020-03-03)
- fix links for documentation (5bb0f40)
- make reset bubble up (09f6808)
5.0.3 (2020-02-26)
Note: Version bump only for package @react-navigation/routers
5.0.2 (2020-02-21)
- tweak error message for navigate (c8ea419)
5.0.1 (2020-02-10)
- merge initial params on replace (80629bf)
5.0.0-alpha.33 (2020-02-04)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.32 (2020-02-04)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.31 (2020-02-03)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.30 (2020-02-02)
- add licenses (0c159db)
5.0.0-alpha.28 (2020-02-02)
- add licenses (0c159db)
5.0.0-alpha.27 (2020-01-24)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.26 (2020-01-23)
- handle popping more than available screens in stack (68ed8a7)
5.0.0-alpha.25 (2020-01-14)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.24 (2020-01-13)
5.0.0-alpha.23 (2020-01-13)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.22 (2020-01-09)
5.0.0-alpha.21 (2020-01-09)
5.0.0-alpha.20 (2020-01-05)
- preserve focused route in tab on changing screens list (adbeb29)
5.0.0-alpha.19 (2020-01-01)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.18 (2019-12-19)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.17 (2019-12-16)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.16 (2019-12-11)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.15 (2019-11-17)
- merge initial params on push (11efb06)
5.0.0-alpha.14 (2019-11-10)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.13 (2019-11-08)
- handle invalid initialRouteName gracefully (b5d9ad9)
5.0.0-alpha.12 (2019-11-04)
- close drawer on back button press (3a4c38b)
5.0.0-alpha.11 (2019-10-30)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.10 (2019-10-29)
- use index of first route when rehydrating tab state (7635373)
5.0.0-alpha.9 (2019-10-03)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.8 (2019-09-27)
- close drawer on navigate (655a220)
5.0.0-alpha.7 (2019-08-31)
5.0.0-alpha.6 (2019-08-29)
5.0.0-alpha.5 (2019-08-28)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.4 (2019-08-27)
Note: Version bump only for package @react-navigation/routers
5.0.0-alpha.3 (2019-08-22)
- fix path to typescript definitions (f182315)
5.0.0-alpha.2 (2019-08-22)
- properly handle pop action from stack (61dce7a)