Abhay Sharma
Abhay Sharma

Reputation: 360

Header has been moved to react-navigation-stack

After upgrading the react-navigation to v4.0, i am facing the following issue.

react-native v60.0 react-navigation v4.0.0enter image description here

Upvotes: 2

Views: 1254

Answers (3)

satya164
satya164

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

whtlnv
whtlnv

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

Himanshu G
Himanshu G

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.

  1. Make sure you followed link for basic setup and have all the dependencies installed.

  2. 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

  3. if you are using tabs as well in your application, install react-navigation-tabs as well. For more info follow link

Upvotes: 0

Related Questions