美文网首页ReactNative
React-navigation 在React-native 升

React-navigation 在React-native 升

作者: le_1 | 来源:发表于2017-04-09 10:03 被阅读813次

报错信息为UnableToResolveError: Unable to resolve module react/lib/ReactComponentWithPureRenderMixin from /node_modules/react-navigation/src/views/Header.js
原因: Header.js中引入了ReactComponentWithPureRenderMixin,但后面未发现对这个引入的使用。

1.办法一:
"react": "16.0.0-alpha.3", "react-native": "0.43.2", "react-navigation": "git+[https://github.com/react-community/react-navigation.git#7edd9a7](https://github.com/react-community/react-navigation.git#7edd9a7)"
把package.json改成上面的版本 把node-modules 文件夹删除,再npm install .

2.办法二:
将header.js第12行的代码

import ReactComponentWithPureRenderMixin from 'react/lib/ReactComponentWithPureRenderMixin';
删除

详见 https://github.com/react-community/react-navigation/issues/923

相关文章

网友评论

  • 张大娃创业笔记:我想问一下,为何我用react navigation做的tabbar然后首页里面使用react-native-scrollview-tab却不能显示对应的页面呢,又没报错还可以滑动,就是不显示页面内容,只有打开一个新页面返回后才能显示,所以我想请教一下大师知道怎么解决吗?

本文标题:React-navigation 在React-native 升

本文链接:https://www.haomeiwen.com/subject/jlqdattx.html