简体   繁体   English

react native 最新版本 0.61.4 的导航错误

[英]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旧项目依赖版本:--“react”:“16.8.3”,“react-native”:“0.59.5”,“react-navigation”:“1.0.0-beta.3”,新项目依赖版本: -- “react”:“16.9.0”,“react-native”:“0.61.4”,“react-navigation”:“^4.0.10”,“react-navigation-stack”:“^1.10.3 ",注意:--我也试过导航版本2、3。请帮忙

代码图像

错误图像

I think the problem is the jump from react-navigation v1 to v4.我认为问题在于从 react-navigation v1 到 v4 的跳转。

Check the createNavigator params检查createNavigator参数

In v4 you should have a navigationConfig param passed like this:在 v4 中,您应该像这样传递一个 navigationConfig 参数:

createNavigator(NavigationView, router, navigationConfig);

https://reactnavigation.org/docs/en/custom-navigators.html#createnavigator 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 https://reactnavigation.org/blog/2018/05/07/react-navigation-2.0.html

and also from v3 and v4.也来自 v3 和 v4。

Adding to Florin's answer, make sure you export wrap your root navigator with appContainer .添加到弗洛林的答案,确保你导出包装你的根导航appContainer

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 react-native:如何检查用户是否拥有最新版本的应用程序 - react-native: how to check user have the latest version of application 如何为使用 CLI 的 React Native 的最新版本添加字体? - How to add fonts for latest version of react native that uses CLI? 我正在使用 react-navigation/native 版本 6^ 但我的 react-navigation 是版本 4 - I am using react-navigation/native version 6^ but my react-navigation is version 4 反应本机和反应本机导航错误 - React-native and react-native-navigation error 用导航和装饰器反应本机Mobx会引发错误 - React native Mobx with navigation and decorator throws an error 在 React Native 中的 Navigation 上带有负载错误的操作“NAVIGATE” - The action 'NAVIGATE' with payload ERROR on Navigation in React Native 在 react native 中将应用导航结构从版本 4 更改为 5 - Changing app navigation structure from version 4 to 5 in react native React Native - console.error: 'React Native 版本不匹配 - React Native - console.error: 'React Native version mismatch Javascript - React Native 控制台错误“版本不匹配” - Javascript - React Native Console error “Version Mismatch” 我们如何在最新版本的 React Navigation v6 中使用(或替代方法)switchNavigator v4(React Navigation)? - How can we use (or alternate method of) switchNavigator v4 (React Navigation) in the latest version React Navigation v6?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM