【APP设计】React-Native之Ant Design Mobile踩坑锦集【持续更新4.12】

小白入坑React-Native,由于错误太多了。而且重复又容易忘,所以打算开坑写点采坑记录

安卓报错:Cannot add a child that doesn’t hava a YogaNodeto a parent without a measure function! (Trying to add a ‘ReactRawTextShadowNode’to a ‘LayoutShadowNode’)
苹果报错: Raw text cannot be used outside of a tag. Not rendering string: ‘Content of first tab’



React-Native代码:

Content of first tab

错误原因:

      所有的文本都要加上文本标签。并且,标签同行时,不能存在空格。否则也会报出这个错误。PS:自己总结的,没啥依据哈哈。

解决方案:

    Content of first tab

补充:IOS端的报错信息更符合错误信息,看Android的时候,查了好久资料都没有发现什么……坑……


安卓报错:unable to load script from assets 'index.android.bundle......'

解决办法

1,在 android/app/src/main 目录下创建一个 assets空文件夹

mkdir android/app/src/main/assets

2,在项目根目录运行

react-native bundle --platform android --dev false --entry-file index.js --bundle-output andro

你可能感兴趣的:(【APP设计】React-Native之Ant Design Mobile踩坑锦集【持续更新4.12】)