undefined is not an object (evaluating route.route

2019-03-16 22:35发布

enter image description here 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

3条回答
别忘想泡老子
2楼-- · 2019-03-16 22:57

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

查看更多
Ridiculous、
3楼-- · 2019-03-16 23:00

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

查看更多
不美不萌又怎样
4楼-- · 2019-03-16 23:08

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

查看更多
登录 后发表回答