React Native 遇到的bug-持续更新

在学习中,遇到的bug,记录一下

1.Duplicate declaration "FontText" --重复声明“FontText”

出现的原因:自己定义了一个text的类,使用时又在import中导入,解决方法:从import中删除FontText,如图

         

2.the<Image>componet cannot contain children.if you want to render content on top of the image ,consider using the <ImageBackground> component or absolute positioning--<图像>不能包含组合的自视图。如果你想呈现内容的形象,考虑使用< ImageBackground >组件

           

3.No bundle URL present.Make sure you're running a packager server or have included a .jsbundle file in your application bundle.

  

原因:运行时打开了翻墙软件(ShadowsocksX),只要关闭就可以

4.Type error:undefined is not an object(evaluating 'style.width')

  

 

5.Super expression error must either be null or a function 

     

注意点在于:1.导入的react-native库的方式2.导入的js文件路径是否正确3.React.Component是否正确

6.TypeError: Cannot read property 'split' of undefined 

   

split:为分割方法,增加未定义(空字符串)的情况即可

7.Invariant Violation:View config not found for name image.

  

View config not found for name XXXX. 一般就是XXXX写的有问题,如应该大写的写成了小写

8.使用TabBarIOS报错react.children.only expected to receive a single react element child

  

9.加载图片require(image!'tabbar_home')报错

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章