ReactNative

React-navigation 在React-native 升

2017-04-09  本文已影响813人  le_1

报错信息为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

上一篇 下一篇

猜你喜欢

热点阅读