导入react-native运行就报错,急求老师指点,谢谢!
[error][tid:com.facebook.react.JavaScript] Seems you're trying to access 'ReactNative.createClass' from the 'react-native' package. Perhaps you meant to access 'React.createClass' from the 'react' package instead?
For example, instead of:
import React, { Component, View } from 'react-native';
You should now do:
import React, { Component } from 'react';
import { View } from 'react-native';
Check the release notes on how to upgrade your code - https://github.com/facebook/react-native/releases/tag/v0.25.1
请问老师:我通过require导入react-native的时候报错,使用以下方式的时候正常:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View,
PixelRatio,
Text,
} from 'react-native';