React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

typeinvalid.png

版本信息:
"react": "16.0.0-alpha.12",
"react-native": "0.46.4",
"react-navigation": "^1.0.0-beta.11"
node:8.0.0
npm:5.0.1

这是版本问题最后无奈只能降低版本。
如果是已经在项目中用了react-navigation那么升级后是没有这个问题的。
如果是新建项目然后使用react-navigation那就会有这个问题。
然后将新项目降级到0.44 删除node_module 使用npm i. 运行还是会报错。
再次删除node_module
运行yarn install.
一切OK。

降级后的版本:
"react": "16.0.0-alpha.6",
"react-native": "^0.44.0",
"react-navigation": "^1.0.0-beta.11"

issue:
https://github.com/react-community/react-navigation/issues/2197
https://github.com/react-community/react-navigation/issues/2177
https://segmentfault.com/q/1010000010286008

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容