Update dependency react-navigation to v4 #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.13.0
->4.4.4
Release Notes
react-navigation/react-navigation
v4.4.4
Compare Source
Note: Version bump only for package react-navigation
v4.4.3
Compare Source
Note: Version bump only for package react-navigation
v4.4.2
Compare Source
Note: Version bump only for package react-navigation
v4.4.1
Compare Source
Note: Version bump only for package react-navigation
v4.4.0
Compare Source
Features
v4.3.9
Compare Source
Bug Fixes
v4.3.8
Compare Source
Note: Version bump only for package react-navigation
v4.3.7
Compare Source
Note: Version bump only for package react-navigation
v4.3.6
Compare Source
Note: Version bump only for package react-navigation
v4.3.5
Compare Source
Note: Version bump only for package react-navigation
v4.3.4
Compare Source
Note: Version bump only for package react-navigation
v4.3.3
Compare Source
Note: Version bump only for package react-navigation
v4.3.2
Compare Source
Note: Version bump only for package react-navigation
v4.3.1
Compare Source
Note: Version bump only for package react-navigation
v4.3.0
Compare Source
Features
v4.2.2
Compare Source
Bug Fixes
v4.2.1
Compare Source
Note: Version bump only for package react-navigation
v4.2.0
Compare Source
4.2.0 (2020-02-24)
Bug Fixes
Features
ScreenProps
parametrizable in TypeScript (#6496) (5d3fd5b)Reverts
v4.1.1
: Release 4.1.1Compare Source
Bug Fixes
v4.1.0
: Release 4.1.0Compare Source
Bug Fixes
Features
ScreenProps
parametrizable in TypeScript (#6496) (ef83e73)v4.0.10
: Release 4.0.10Compare Source
Changes
flow-typed
instead (94d6cca)Bug Fixes
v4.0.9
: Release 4.0.9Compare Source
Bug Fixes
v4.0.8
: Release 4.0.8Compare Source
Bug Fixes
v4.0.7
: Release 4.0.7Compare Source
Bug Fixes
v4.0.6
: Release 4.0.6Compare Source
Bug Fixes
v4.0.5
: Release 4.0.5Compare Source
Bug Fixes
v4.0.4
: Release 4.0.4Compare Source
Bug Fixes
v4.0.3
: Release 4.0.3Compare Source
Bug Fixes
v4.0.2
: Release 4.0.2Compare Source
Bug Fixes
v4.0.1
: Release 4.0.1Compare Source
Bug Fixes
v4.0.0
: Release 4.0.0Compare Source
In this release, we've extracted out the navigators to separate packages to make it easier to maintain and release updates faster. You can follow the guide below to upgrade your projects.
Upgrading
Install the new packages
First, we need to install the
react-navigation
package along with the various navigators. If you don't use some of these navigators, you can omit them.To install them, run:
This will install the versions compatible with your code if you were using
[email protected]
, so you wouldn't need any more changes beyond changing the imports.Changing your code
Then change any imports for stack, tabs or drawer to import from the above packages instead of
react-navigation
.The following imports need to be changed to import from
react-navigation-stack
:createStackNavigator
StackGestureContext
Transitioner
StackView
StackViewCard
StackViewTransitionConfigs
Header
HeaderTitle
HeaderBackButton
HeaderStyleInterpolator
The following imports need to be changed to import from
react-navigation-tabs
:createBottomTabNavigator
createMaterialTopTabNavigator
BottomTabBar
MaterialTopTabBar
The following imports need to be changed to import from
react-navigation-drawer
:createDrawerNavigator
DrawerGestureContext
DrawerRouter
DrawerActions
DrawerView
DrawerNavigatorItems
DrawerSidebar
Upgrading navigators (optional)
You don't need to upgrade the navigators to their latest version when upgrading to
[email protected]
. You can upgrade them separately later as per your convenience.Installing dependencies
The latest drawer and tabs depend on
react-native-gesture-handler
andreact-native-reanimated
. If you already have these libraries installed and at the latest version, you are done here! Otherwise, read on for installation instructions for these dependencies.Installing dependencies into an Expo managed project
In your project directory, run the following:
This will install versions of these libraries that are compatible.
Installing dependencies into a bare React Native project
In your project directory, run
yarn add react-native-reanimated react-native-gesture-handler react-native-screens
.Next, we need to link these libraries. The steps depends on your React Native version:
React Native 0.60 and higher
On newer versions of React Native, linking is automatic.
To complete the linking on iOS, make sure you have Cocoapods installed. Then run:
React Native 0.59 and lower
If you're on an older React Native version, you need to manually link the dependencies. To do that, run:
To finalize installation of
react-native-gesture-handler
for Android, make the following modifications toMainActivity.java
:Upgrading packages
To upgrade
react-navigation-tabs
, run:For list of breaking changes, refer to the release notes.
To upgrade
react-navigation-drawer
, run:For list of breaking changes, refer to the release notes.
More info
For more info and release notes, please refer to the individual packages:
react-navigation-stack
(Changelog)react-navigation-drawer
(Changelog)react-navigation-tabs
(Changelog)TypeScript
If you're using TypeScript, you'll also need to upgrade the navigators to the latest version following the previous section. Since the navigators have been extracted out, navigator specific types have been removed from the main package. You'll need to update the types accordingly:
NavigationScreenProp
with:NavigationSwitchProp
forcreateSwitchNavigator
fromreact-navigation
NavigationStackProp
forcreateStackNavigator
fromreact-navigation-stack
NavigationTabProp
forcreateBottomTabNavigator
andcreateMaterialTopTabNavigator
fromreact-navigation-tabs
NavigationDrawerProp
forcreateDrawerNavigator
fromreact-navigation-drawer
NavigationScreenProps
with:NavigationSwitchScreenProps
forcreateSwitchNavigator
fromreact-navigation
NavigationStackScreenProps
forcreateStackNavigator
fromreact-navigation-stack
NavigationTabScreenProps
forcreateBottomTabNavigator
andcreateMaterialTopTabNavigator
fromreact-navigation-tabs
NavigationDrawerScreenProps
forcreateDrawerNavigator
fromreact-navigation-drawer
NavigationScreenOptions
with:NavigationStackOptions
forcreateStackNavigator
fromreact-navigation-stack
NavigationBottomTabOptions
forcreateBottomTabNavigator
fromreact-navigation-tabs
NavigationMaterialTabOptions
forcreateMaterialTopTabNavigator
fromreact-navigation-tabs
NavigationDrawerOptions
forcreateDrawerNavigator
fromreact-navigation-drawer
NavigationScreenComponent
with:NavigationSwitchScreenComponent
forcreateSwitchNavigator
fromreact-navigation
NavigationStackScreenComponent
forcreateStackNavigator
fromreact-navigation-stack
NavigationBottomTabScreenComponent
forcreateBottomTabNavigator
fromreact-navigation-tabs
NavigationMaterialTabScreenComponent
forcreateMaterialTopTabNavigator
fromreact-navigation-tabs
NavigationDrawerScreenComponent
forcreateDrawerNavigator
fromreact-navigation-drawer
See the docs for more details: https://reactnavigation.org/docs/en/typescript.html
TypeScript support is still a work in progress, so please open an issue in the respective package's repo if you're facing a problem.
Documentation
Updated documentation can be found on the official website.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.