cannot read property ReactCurrentOwner of undefined

react native 从0.44升级0.46.4后报错
如图:


cannot read property ReactCurrentOwner of undefined_第1张图片
reactcurrent.png

解决:
1:首先新建一个react native项目运行 如果报错那说明此版本有问题不升级。没有错误 则打开package文件.


cannot read property ReactCurrentOwner of undefined_第2张图片
version.png

2:升级自己的项目npm install react-native@xxx —save
3:对比新建项目的package 修改版本react,react-test-renderer …
4: 删除node_modules
5: npm i 然后运行即可

你可能感兴趣的:(cannot read property ReactCurrentOwner of undefined)