報(bào)錯(cuò)信息為UnableToResolveError: Unable to resolve module react/lib/ReactComponentWithPureRenderMixin from /node_modules/react-navigation/src/views/Header.js
原因: Header.js中引入了ReactComponentWithPureRenderMixin爬范,但后面未發(fā)現(xiàn)對(duì)這個(gè)引入的使用。
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';
刪除
詳見(jiàn) https://github.com/react-community/react-navigation/issues/923