Rreact Native 常见错误总结
2016-12-01 21:50
393 查看
http://blog.csdn.net/jj120522/article/details/51900016
http://blog.csdn.net/jj120522/article/details/51900016
http://blog.csdn.net/jj120522/article/details/51900016
Rreact Native 常见错误总结
标签: ReactNative 常见错误react native
2016-07-25 12:25 2341人阅读 评论(2) 收藏 举报
分类:
React Native(14)
版权声明:本文为博主原创文章,未经博主允许不得转载。
1.invariant violation:expected a component class,got[object object]
创建自定义组件首字母要大写,否则会报错.
2.Module 0 is not a registered callable module.
将gradle升级成最新版本(cd
Android 进入android目录执行:sudo
./gradlew clean) 或者通过android studio工具升级.
3.android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
该错误属于安卓Native的错误,如果引用的Activity不存在或者已经销毁,再次引用就会报该错误,如果是React
Native 调用原生控件的话,创建控件需要引用:getCurrentActivity()
4.android.app.Application cannot be cast to com.facebook.React.ReactApplication
需要将创建的MainApplication在AndroidManifest.xml配置好.
5.Element type is invalid: expected a string (for built-in components)
or a class/function but got: object
发生原生一般是你引用了无效的组件,如果组件确实正确,看下引用的组件是否正常导出:(export defalut)
6.react native undefined is not an object (evaluating this....
发生该错误的一般是忘记bind(this),只要回调函数中需要用到this的,一般都需要bind.
7.react native - expected a component class, got [object Object]
该错误可能是你引用了小写的组件,组件首字母一定要大写,比如<login/>应该写成<Login/>
相关文章推荐
- Android Rreact Native 常见错误总结
- 【React Native】Rreact Native 常见错误总结
- Rreact Native 常见错误总结
- Rreact Native 常见错误总结
- Rreact Native 常见错误总结
- Rreact Native 常见错误总结
- React native 常见错误:unable to resolve module react-native-scrollable-tab-view
- React Native 常见问题总结(android端)
- React-Native 常见错误及其原因
- React Native 开发常见错误
- React-native 常见错误:Seems you're trying to access 'ReactNative.Component' from the 'react-native'
- React-native 常见错误:Could not get BatchedBridge, make sure your bundle is packaged correctly
- react native 学习一(环境搭配和常见错误的解决)
- ReactNative常见错误
- vs开发工具常见错误总结
- C/C++之函数返回值为指针或者是引用时常见错误总结