react native 遇到的问题整理

1.Uncaught TypeError: Super expression must either be null or a function, not

原因  在组件化继承React.Component 时  将Component 写成了小写component   导致这个错   所以在react native 中一定要注意大小写。

2.在自己编辑了一个继承Component后在别的地方引用总是有问题,提示找不到这个组件,可能的原因

a.可能是你的引用地址没写对。

b.可能是你的文件名后面没有写.js

c.可能是你的文件没有export defult filename 或者module.export = className

(其中export 方式引用要用import    而 module 引用则需要用require(路径))

3.在你编写一个function 后再return中返回一个view  但是总是显示不出来这个view   可能的原因:

a.标签<View> 要与 return 并排。



发布了49 篇原创文章 · 获赞 5 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/hehe0705/article/details/66479886