微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ReactNative 伤机杂坑集

!!!温馨提示:为了方便找到问题,请在本页按ctrl+f(command+f)进行关键字搜索

Android

MainActivity中没有getPackages()方法重载

现在网上很多编写自定义原生模块给JS调用的教程,但是很多教程的RN版本是较老的,老版本中(目前知道0.28及0.28以前),RN自动生成的Android项目中,MainActivity中有getPackages()方法重载,但是在0.29及0.29以后,需要再MainApplication中调用

———————————-华丽的分割线———————————–

error: bundling: UnabletoResolveError: Unable to resolve module react/lib/ReactDebugCurrentFrame

报错代码

error: bundling: UnabletoResolveError: Unable to resolve module `react/lib/ReactDebugCurrentFrame`
from ....\node_modules\react-native\Libraries\Renderer\src\renderers\shared\stack\reconciler\ReactCompositeComponent.js: Module does not exist in the module map or in these directories:
...\node_modules\react\lib

原因

如果项目”react-native”: “^0.43.X”那么选用react “react”: “16.0.0-alpha.6”

解决办法


参考:https://github.com/facebook/react-native/issues/13017 ———————————-华丽的分割线———————————–

原文地址:https://www.jb51.cc/react/304992.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐