美文网首页
ReactNative从零开始笔记-常见问题(持续更新中)

ReactNative从零开始笔记-常见问题(持续更新中)

作者: 摸着石头过河_崖边树 | 来源:发表于2018-12-28 22:27 被阅读24次

一、使用环境

  • Mac 电脑 系统10.14.2
  • Xcode9.4
  • react-native-cli版本 2.0.1
  • react-native: 0.57.3
  • webstorm

二、常见问题

1、运行react-native 项目 模拟报错
image.png

解决办法: 执行命令

npm install --build-from-source
2、使用系统导航报错

Navigator is deprecated and has been removed from this package. It can now be installed

image.png

原因:从0.44版本开始,Navigator被从react native的核心组件库中剥离到了一个名为react-native-deprecated-custom-components的单独模块中,而且官方推荐使用React Navigation导航组件,这个已经默认为官方推荐了

解决办法:安装组件 执行命令

npm install react-native-deprecated-custom-components  --save
3 、Invariant Violation: Text strings must be rendered within a <Text> component
image.png
4. 运行报错 No bundle URL present
image.png

解决办法:

  1. 关闭模拟器,完全对退出模拟器
  2. 重新运行react-native run-ios

相关文章

网友评论

      本文标题:ReactNative从零开始笔记-常见问题(持续更新中)

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