在React Native中创建容器的SyntaxError

时间:2017-04-27 03:26:08

标签: react-native

在本教程(https://www.raywenderlich.com/126063/react-native-tutorial)中,作者声明如下:

接下来在HelloWorld组件下面添加以下类:

class PropertyFinderApp extends React.Component {
  render() {
    return (

    );
  }
}

但是当我尝试这样做时,我会遇到以下问题:

[错误屏幕] [2]

我不确定如何修复它。这是我的代码:

'use strict';

var React = require('react');
var ReactNative = require('react-native');

var styles = ReactNative.StyleSheet.create({
  text: {
    color: 'black',
    backgroundColor: 'white',
    fontSize: 30,
    margin: 80
  },
  container: {
    flex: 1
  }
});


class HelloWorld extends React.Component {
  render() {
    return <ReactNative.Text style={styles.text}>Hello World (Again)    </ReactNative.Text>;
  }
}

class PropertyFinderApp extends React.Component {
  render() {
    return (

    );
  }
}

ReactNative.AppRegistry.registerComponent('PropertyFinder', function() { return PropertyFinderApp });

0 个答案:

没有答案