超级表达式错误必须为null或函数

时间:2016-05-26 02:58:52

标签: react-native

我尝试学习反应本机,但我无法加载应用程序 使用: react-native 0.26.2

这是屏幕截图screenshot

在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找到这些课程。我已经尝试升级,但我仍然收到错误!请帮忙!谢谢!

1 个答案:

答案 0 :(得分:-3)

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';