Atul Tiwari
Atul Tiwari

Reputation: 604

Navigation error with react native latest version 0.61.4

I upgraded my old project in react native version(0.61.4) then getting error related navigation option undefined.

Old project dependency version:-- "react": "16.8.3", "react-native": "0.59.5", "react-navigation": "1.0.0-beta.3", New Project dependency versions:-- "react": "16.9.0", "react-native": "0.61.4", "react-navigation": "^4.0.10", "react-navigation-stack": "^1.10.3", Note:-- I also tried with navigation version 2, 3. please help

code image

error image

Upvotes: 0

Views: 486

Answers (2)

Kiran JD
Kiran JD

Reputation: 571

Adding to Florin's answer, make sure you export wrap your root navigator with appContainer.

Docs: https://reactnavigation.org/docs/en/app-containers.html

Upvotes: 0

Florin Dobre
Florin Dobre

Reputation: 10252

I think the problem is the jump from react-navigation v1 to v4.

Check the createNavigator params

In v4 you should have a navigationConfig param passed like this:

createNavigator(NavigationView, router, navigationConfig);

https://reactnavigation.org/docs/en/custom-navigators.html#createnavigator

If still not working probably you should check the breaking changes from here

https://reactnavigation.org/blog/2018/05/07/react-navigation-2.0.html

and also from v3 and v4.

Upvotes: 2

Related Questions