【发布时间】:2017-12-28 17:29:52
【问题描述】:
我开始学习 React Native。我正在学习教程并编写了以下代码:
var React = require('react-native');
var {
Text,
View,
AppRegistry
} = React;
var StopWatch = React.createClass({
render: function() {
}
});
AppRegistry.registerComponent('stopwatch', function() {
return StopWatch;
});
但是,我收到了这个错误:
undefined is not a function (evaluating 'React.createClass({displayName:'StopWatch',
render:function render() {}
})')
我在 Android 模拟器中运行 React Native,使用命令
react-native run-android
文件是
App.js
【问题讨论】:
标签: android react-native ecmascript-6