Reputation: 360
After upgrading the react-navigation to v4.0, i am facing the following issue.
react-native v60.0
react-navigation v4.0.0
Upvotes: 2
Views: 1254
Reputation: 10142
All migration instructions are mentioned in the release notes
https://github.com/react-navigation/react-navigation/releases/tag/v4.0.0
Upvotes: 0
Reputation: 2227
If you already have react-navigation-stack
added to your package.json
:
Search in your code for the line:
import { Header } from 'react-navigation';
or similar. And replace with:
import { Header } from 'react-navigation-stack';
Upvotes: 1
Reputation: 169
A lot has been changed since latest react-navigation release(v4)
In your case make sure that you have all the dependencies installed that are now a part of react-navigation.
Make sure you followed link for basic setup and have all the dependencies installed.
You have to install react-navigation-stack dependency in order to use createStackNavigator now so in your terminal(project folder)
run - yarn add react-navigation-stack.For more info follow link
if you are using tabs as well in your application, install react-navigation-tabs as well. For more info follow link
Upvotes: 0