React-Native 报错汇聚和解决方案

作者: wg689 | 来源:发表于2019-01-01 17:19 被阅读10次

问题1:

react-native Element type is invalid: expected a string (for built-in components) or a class/functio

这个是组件导入的方式不对
最开始的方法(会报错)

export default class FOFSegmentControl extends Component{}

修改为下面(搞定)

 class FOFSegmentControl extends Component{
 
});
module.exports = FOFSegmentControl;

从报错的类型来说这个报错比较迷惑人, 期望是一个字符串类型 实际上给了是一个func 类型, 如果按照翻译的方法 这个错误就是类型不对, 实际上是 导出的组件有问题

问题2

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

关掉模拟器, 关掉终端, 重新react-native run-ios 即可

相关文章

网友评论

    本文标题:React-Native 报错汇聚和解决方案

    本文链接:https://www.haomeiwen.com/subject/ofenlqtx.html