Ad

Navigation Error With React Native Latest Version 0.61.4

- 1 answer

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

Ad

Answer

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.

Ad
source: stackoverflow.com
Ad