【问题标题】:Super expression error must either be null or a function超级表达式错误必须为 null 或函数
【发布时间】:2016-09-23 20:45:24
【问题描述】:

我正在尝试学习 React Native,但我无法加载应用程序 使用 : react-native 0.26.2

这是截图

在IOS控制台中,有2016-05-25 22:56:06.525 [warn][tid:main][RCTEventEmitter.m:41] Sending websocketFailed with no listeners registered. 2016-05-25 22:56:06.543 [error][tid:com.facebook.react.JavaScript] Super expression must either be null or a function, not undefined 2016-05-25 22:56:06.545 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Super expression must either be null or a function, not undefined 2016-05-25 22:56:06.562 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module. 2016-05-25 22:56:06.563 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module.

似乎找不到来自react-native 的课程。我已经尝试升级,但我仍然收到错误!请帮忙!谢谢!

【问题讨论】:

    标签: react-native


    【解决方案1】:
    import React, {
      AppRegistry,
      Platform,
      Component,
      TouchableOpacity,
      StyleSheet,
      Navigator,
      View,
      Text
    } from 'react-native';
    

    而不是

    import React,{Component} from 'react';
    import{
      AppRegistry,
      Platform,
      TouchableOpacity,
      StyleSheet,
      Navigator,
      View,
      Text
    } from 'react-native';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-11
      • 2023-01-29
      • 2021-10-20
      • 2018-02-27
      相关资源
      最近更新 更多