Super expression must either be null or a function, not undefined

按照之前买的用JavaScript开发移动应用的例子来编写的,然后报了这个错。我的头部声明是这样的

var React = require('react-native');
var {
Text,
View
} = React;

经过查询后是由于'React'和'Component'从'react native'分离到了'react'模块。
所以这里我们只引入'react native'的模块是不够的,改成这样:

import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
原文地址:https://www.cnblogs.com/liulipeng/p/7112870.html