undefined is not an object (evaluating route.routeName)

感情迁移 提交于 2019-12-03 14:04:48

问题


when update the expo from (16.0.0) to (24.0.0) and react navigation from (git+https://github.com/react-community/react-navigation.git) to (^1.0.0-beta.21) version, this error occured


回答1:


Finally found out how to solve this, its an undocumented DrawerNavigatorConfig:

drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle'

Look here: https://github.com/react-community/react-navigation/issues/3148#issuecomment-352778884




回答2:


remove ^ from package json before react-nativetion package

it should be look like this "react-navigation": "1.0.0-beta.20"

not "react-navigation": "^1.0.0-beta.20" (^ means you are allowing npm install to the install latest version which is the cause of the problem )

after removing ^ you have to delete your node_module and then Run npm install this will install correct packages for your current project




回答3:


Simply, change to "react-navigation": "1.0.0-beta.26" from "react-navigation": "1.0.0-beta.20"



来源:https://stackoverflow.com/questions/47886782/undefined-is-not-an-object-evaluating-route-routename

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!