All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
7.0.0-alpha.2 (2023-06-22)
- drop custom fromEntries in favor of Object.fromEntries (9fe34b4), closes /reactnative.dev/blog/2022/06/21/version-069#highlights-of-069 - by @satya164
- support a top-level path configuration in linking config (1d0297e) - by @satya164
- this means we now require at least iOS 12.2 and React Native 0.69 whose minimum supported iOS version is 12.4
7.0.0-alpha.1 (2023-03-01)
- fix paths in sourcemap files (368e069) - by @satya164
- properly export types to avoid webpack warning (4f597a8) - by @satya164
7.0.0-alpha.0 (2023-02-17)
-
fix type of setOptions and mark data passed to callbacks as Readonly (6655c66) - by @satya164
-
remove defaultScreenOptions from default navigator options (6267952) - by @satya164
-
support dispatching action to child without 'navigationInChildEnabled' if 'target' is specified (debd620) - by @satya164
-
fix!: align onReady callback and navigationRef.isReady (1959baa) - 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
- support statically confguring navigation tree (#11144) (4cc322e) - by @satya164
- Previously, the
onReady
prop andnavigationRef.isReady()
work slightly differently. TheonReady
callback fired whenNavigationContainer
finishes mounting and deep links is resolved. ThenavigationRef.isReady()
method additionally checks if there are any navigators rendered - which may not betrue
if the user is rendering their navigators conditionally inside aNavigationContainer
.
This changes onReady
to work similar to navigationRef.isReady()
. The onReady
callback will now fire only when there are navigators rendered - reflecting the value of
navigationRef.isReady()
.
- 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.4.1 (2022-11-21)
6.4.0 (2022-09-16)
- add missing parentheses typo in useFocusEffect error message (#10688) (9203045)
- handle path with empty string properly for linking (#10708) (e8c374e)
- potential prototype pollution attacks (#10455) (10e5d2b)
- prevent Object properties to be used as parsing functions (#10570) (7fbd3e5)
- strongly type the
component
prop onRouteConfigComponent
(#10519) (55da7c9) - wrong setParams type if route does not have params (#10512) (8ed42cd)
6.3.0 (2022-08-24)
- add missing parentheses typo in useFocusEffect error message (#10688) (9203045)
- handle path with empty string properly for linking (#10708) (e8c374e)
- potential prototype pollution attacks (#10455) (10e5d2b)
- prevent Object properties to be used as parsing functions (#10570) (7fbd3e5)
- strongly type the
component
prop onRouteConfigComponent
(#10519) (55da7c9) - wrong setParams type if route does not have params (#10512) (8ed42cd)
6.2.2 (2022-07-05)
- ensure same @types/react version in repo (#10663) (e662465), closes #10655
- make event listeners idempotent (#10667) (3bb31e9), closes #10664
6.2.1 (2022-04-01)
- return undefined instead of throwing when parent is not found (28a3993)
6.2.0 (2022-04-01)
- add an ID prop to navigators (4e4935a)
6.1.1 (2022-01-29)
- removal of non-existing listener should not break updating ref (#10067) (d206ffe)
- warn for components starting with lower case names (4b4a7c5)
6.1.0 (2021-10-12)
- add a
navigationKey
prop to Screen and Group (b2fa62c)
6.0.3 (2021-10-09)
Note: Version bump only for package @react-navigation/core
6.0.2 (2021-09-26)
- automatically queue listeners when container isn't ready (acdde18)
- change error when using React Navigation 4 API (a802c9d)
- update the error message for registering navigators (171d7e1)
6.0.1 (2021-08-03)
6.0.0 (2021-08-01)
6.0.0-next.17 (2021-07-16)
- use nested params for initial state only (577d79e)
6.0.0-next.16 (2021-07-16)
- prevent navigation state updates after state cleanup (#9688) (16f0e11)
- sort wildcard and :params (#9672) (4135d09)
6.0.0-next.15 (2021-07-01)
- fix typechecking in linking config (b1134c8)
- show stack trace in the flipper plugin (97772af)
6.0.0-next.14 (2021-06-10)
- show stack trace in the flipper plugin (97772af)
6.0.0-next.13 (2021-05-29)
- validate property names in linking config (324ea71)
6.0.0-next.12 (2021-05-29)
6.0.0-next.11 (2021-05-27)
Note: Version bump only for package @react-navigation/core
6.0.0-next.10 (2021-05-26)
- add screenListeners prop on navigators similar to screenOptions (cde44a5)
- expose container ref in useNavigation (1d40279)
6.0.0-next.9 (2021-05-23)
Note: Version bump only for package @react-navigation/core
6.0.0-next.8 (2021-05-16)
- fix type error when passing unannotated navigation ref (dc4ffc0)
6.0.0-next.7 (2021-05-10)
- return a NavigationContent component from useNavigationBuilder (1179d56)
6.0.0-next.6 (2021-05-09)
- fix type annotations for useNavigation (again) (929c3e3)
6.0.0-next.5 (2021-05-09)
- fix type annotations for useNavigation (7da45e1)
6.0.0-next.4 (2021-05-09)
- add a new component to group multiple screens with common options (1a6aebe)
- add ability to specify root param list (b28bfdd)
6.0.0-next.3 (2021-05-01)
6.0.0-next.2 (2021-04-08)
- properly resolve initialRouteNames (c38906a)
6.0.0-next.1 (2021-03-10)
Note: Version bump only for package @react-navigation/core
6.0.0-next.0 (2021-03-09)
- add missing helper types in descriptors (21a1154)
- check duplicate names only for immediate nested screens (36a9b4f)
- don't merge params on navigation (366d018)
- drop dangerously prefix from getState and getParent (227f133)
- drop support for legacy linking config (0e13e8d)
- fix default screen options not being respected (03ba1f2)
- fix incorrect state change events in independent nested container (b82a912), closes #9080
- print an error when passing a second argument to useFocusEffect (c361795)
- remove the state property from route prop (ebab518)
- show redbox instead of crash if navigation isn't initialized (13d8553)
- add a way to specify an unique ID for screens (15b8bb3)
- add an option to specify default options for the navigator (c85f2ff)
- allow returning null or undefined to skip actions with dispatch (d6466b7)
- associate path with the route it opens when deep linking (#9384) (86e64fd), closes #9102
- warn on duplicate screen names across navigators (02a031e)
- This commit drops support for legacy linking config which allowed screens to be specified without the screens property in the config.
- 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.
- any code which relies on
route.state
will break.
Previous versions printed a warning on accessing route.state
. This commit removes the property entirely. Accessing this property isn't safe since child navigator state isn't gurranteed to be in sync with parent navigator state and cause subtle bugs in apps.
5.14.3 (2020-11-10)
- improve the error message for incorrect screen configuration (8f764d8)
5.14.2 (2020-11-09)
- throw if the same pattern resolves to multiple screens (48b2e77)
5.14.1 (2020-11-08)
- tweak error message when navigator has non-screen children (360b0e9)
5.14.0 (2020-11-04)
- always respect key in the route object when generating action (cb2e744)
- add a NavigatorScreenParams type. closes #6931 (e3e58c2)
- add warning on accessing the state object on route prop (ec7b02a)
5.13.5 (2020-11-04)
- don't use use-subscription to avoid peer dep related errors (66f3a4a), closes /github.com/react-navigation/react-navigation/issues/9021#issuecomment-721679760
- use useDebugValue in more places (b20f2d1)
5.13.4 (2020-11-03)
- fix nested navigation not working the first time (ebc7f9e)
5.13.3 (2020-11-03)
- handle navigating to same screen again for nested screens (0945689)
5.13.2 (2020-10-30)
- fix params from for the root screen when creating action (e8515f9), closes #9006
- trim routes if an index is specified in state (fb7ac96)
5.13.1 (2020-10-28)
- improve types for route prop in screenOptions (d26bcc0)
5.13.0 (2020-10-24)
- add an unhandled action listener (#8895) (80ff5a9)
- allow deep linking to reset state (#8973) (7f3b27a), closes #8952
- improve types for navigation state (#8980) (7dc2f58)
- update helper types to have navigator specific methods (f51086e)
5.12.5 (2020-10-07)
Note: Version bump only for package @react-navigation/core
5.12.4 (2020-09-22)
5.12.3 (2020-08-04)
Note: Version bump only for package @react-navigation/core
5.12.2 (2020-07-28)
Note: Version bump only for package @react-navigation/core
5.12.1 (2020-07-19)
- make sure new state events are emitted when new navigators mount (af8b274)
5.12.0 (2020-07-10)
- avoid error setting warning for devtools migration. closes #8534 (1801a13)
- fix bubbling actions to correct target when specified (9671c76)
- fix options event being emitted incorrectly (#8559) (a255e35)
- improve the warning message for non-serializable values (e63580e)
- mark some types as read-only (7c3a0a0)
5.11.1 (2020-06-25)
5.11.0 (2020-06-24)
- fix getCurrentOptions for nested screens (6730690)
- fix getCurrentOptions for nested screens (afc83ee)
- more improvements to types (d244488)
- add devtools package (#8436) (95b044e)
- add event for options on container (#8334) (fe3f98e)
- add helper to get focused route name from nested state (#8435) (f51f9c8)
- rework linking configuration to be more strict (#8502) (a021cfb)
5.10.0 (2020-06-06)
- catch missing params when they are required in navigate (#8389) (8774ca9)
- make sure the wildcard pattern catches nested unmatched routes (c3bd349)
- only use the query params for focused route in path (2d66ef9)
- prevent state change being emitted unnecessarily (ab1f79c)
5.9.0 (2020-05-27)
5.8.2 (2020-05-23)
Note: Version bump only for package @react-navigation/core
5.8.1 (2020-05-20)
Note: Version bump only for package @react-navigation/core
5.8.0 (2020-05-20)
5.7.0 (2020-05-16)
- don't use Object.fromEntries (51f4d11)
- add a PathConfig type (60cb3c9)
5.6.1 (2020-05-14)
- don't use flat since it's not supported in node (21b397f)
5.6.0 (2020-05-14)
- ignore extra slashes in the pattern (3c47716)
- ignore state updates when we're not mounted (0149e85), closes #8226
5.5.2 (2020-05-08)
5.5.1 (2020-05-08)
5.5.0 (2020-05-05)
- add support for optional params to linking (#8196) (fcd1cc6)
- support params anywhere in path segement (#8184) (3999fc2)
5.4.0 (2020-04-30)
- add
useLinkBuilder
hook to build links (2792f43)
5.3.5 (2020-04-27)
- add config to enable redux devtools integration (c9c825b)
5.3.4 (2020-04-17)
- add initial option for navigating to nested navigators (004c7d7)
- add initial param for actions from deep link (a3f7a5f)
- handle initial: false for nested route after first initialization (187aefe)
5.3.3 (2020-04-08)
- switch order of focus and blur events. closes #7963 (ce3994c)
- workaround warning about setState in another component in render (d4fd906)
5.3.2 (2020-03-30)
5.3.1 (2020-03-23)
- don't emit events for screens that don't exist anymore (1c00142)
- only call listeners for focused screen for global events (3096de6)
5.3.0 (2020-03-22)
- support function in listeners prop (3709e65)
5.2.3 (2020-03-19)
Note: Version bump only for package @react-navigation/core
5.2.2 (2020-03-16)
Note: Version bump only for package @react-navigation/core
5.2.1 (2020-03-03)
5.2.0 (2020-02-26)
5.1.6 (2020-02-21)
- avoid emitting focus events twice (f167008), closes #6749
- preserve screen order with numeric names (125bd70), closes #6900
5.1.5 (2020-02-19)
- show descriptive error for invalid return for useFocusEffect (1a28c29)
5.1.4 (2020-02-14)
5.1.3 (2020-02-14)
- return false for canGoBack if navigator hasn't finished mounting (c8ac5fa)
- throw a descriptive error if navigation object hasn't initialized (b6accd0)
- update links in error messages (f964200)
5.1.2 (2020-02-12)
- fix false positives for circular object check (030c63c), closes #6827
- static container memo check (#6825) (2bf0958)
5.1.1 (2020-02-11)
- don't cleanup state on switching navigator (359ae1b)
5.1.0 (2020-02-10)
- add some links in the error messages (13b4e07)
5.0.0-alpha.43 (2020-02-04)
- improve error message for unhandled action (ca4a360)
5.0.0-alpha.42 (2020-02-04)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.41 (2020-02-03)
- ignore circular references when checking serializable (e5063b9)
5.0.0-alpha.40 (2020-02-02)
- add licenses (0c159db)
- add warning when passing inline function to component prop (fa4a959)
- tweak error messages for validation (2243b45)
- add
screens
prop for nested configs (#308) (b931ae6) - add useIsDrawerOpen hook (#299) (ecd68af)
- integrate with history API on web (5a3f835)
5.0.0-alpha.38 (2020-02-02)
- add licenses (0c159db)
- add warning when passing inline function to component prop (fa4a959)
- tweak error messages for validation (2243b45)
- add
screens
prop for nested configs (#308) (b931ae6) - add useIsDrawerOpen hook (#299) (ecd68af)
- integrate with history API on web (5a3f835)
5.0.0-alpha.37 (2020-01-24)
- add error message when trying to use v4 API with v5 (179e807)
- validate screen configs (2f1f0af)
- warn if non-serializable values found in state (5751e7f)
5.0.0-alpha.36 (2020-01-23)
- disallow canPreventDefault option if not present in types (d9059b5)
- don't add ?if query params is empty (3bf5ddd)
- fix types for useFocusEffect (23ab45a), closes #270
- make sure that we return correct value if selector changes (6c2acbb), closes /github.com/react-navigation/navigation-ex/pull/273#issuecomment-576581225
- use protected for private value store (ad4eaff)
- add useNavigationState hook (32a2206)
- let the navigator specify if default can be prevented (da67e13)
- support nested config in getPathFromState (#266) (1e53821)
5.0.0-alpha.35 (2020-01-14)
- fix intellisense for CompositeNavigationProp (a912323)
5.0.0-alpha.34 (2020-01-13)
5.0.0-alpha.33 (2020-01-13)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.32 (2020-01-09)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.31 (2020-01-09)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.30 (2020-01-01)
- cleanup transaction even if action wasn't handled (f462d67)
- show error if an action was not handled (0252bdc)
5.0.0-alpha.29 (2019-12-19)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.28 (2019-12-16)
5.0.0-alpha.27 (2019-12-10)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.26 (2019-12-07)
5.0.0-alpha.25 (2019-11-29)
5.0.0-alpha.24 (2019-11-20)
5.0.0-alpha.23 (2019-11-17)
- merge initial params on push (11efb06)
5.0.0-alpha.22 (2019-11-10)
- throw when containers are nested within another (d4072e7)
5.0.0-alpha.21 (2019-11-08)
5.0.0-alpha.20 (2019-11-02)
- pass rehydrated state in onStateChange and devtools (5a34764)
5.0.0-alpha.19 (2019-10-30)
5.0.0-alpha.18 (2019-10-29)
- improve type annotation for screens (8f16085)
5.0.0-alpha.17 (2019-10-22)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.16 (2019-10-18)
- rehydrate state before using it (3e92e22)
5.0.0-alpha.15 (2019-10-15)
5.0.0-alpha.14 (2019-10-06)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.13 (2019-10-03)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.12 (2019-10-03)
- don't merge state with existing state during reset. fixes #111 (7393464)
- don't throw when switching navigator. fixes #91 (19be2b4)
5.0.0-alpha.11 (2019-09-27)
- add a method to reset root navigator state (e61f594)
5.0.0-alpha.10 (2019-09-17)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.9 (2019-09-16)
- compatibility layer (e0f28a4)
- make deep link handling more flexible (849d952)
- make example run as bare react-native project as well (#85) (d16c20c)
5.0.0-alpha.8 (2019-09-04)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.7 (2019-08-31)
- fix navigation object changing too often (3c840bb)
5.0.0-alpha.6 (2019-08-31)
5.0.0-alpha.5 (2019-08-30)
Note: Version bump only for package @react-navigation/core
5.0.0-alpha.4 (2019-08-29)
- export NavigationContext (9245c79)
- handle navigating with both with both key and name (#83) (6b75cba)
5.0.0-alpha.3 (2019-08-27)
5.0.0-alpha.2 (2019-08-22)
- fix path to typescript definitions (f182315)
- don't apply action to an unrelated router (e1d7333)
- fix peer deps and add git urls (6b4fc74)
- handle partial initial state better when rehydrating (8ed54da)
- implement canGoBack for tab router (#51) (2b8f2ed)
- properly infer route type in screen elements (7e3a2c8)
- throw when duplicate screens are defined (adc2fe4)
- use correct dispatch in methods in screen's navigation prop (8134895)
- add a target key to actions and various fixes (747ce66)
- add a useIsFocused hook to get focus state (#52) (2b59f7e)
- add canGoBack (#50) (e9da86e)
- add dangerouslyGetParent (#62) (c0045d8)
- add dangerouslyGetState (#63) (f7ff0c1)
- add helpers to convert between url and state (dbe2b91)
- add hook for deep link support (35987ae)
- add integration with redux devtools extension (ca985bb)
- add native container with back button integration (#48) (b7735af)
- integrate reanimated based stack (#42) (dcf57c0)