我正在學習本教程以使React Native應用程序 - >https://firebase.googleblog.com/2016/01/the-beginners-guide-to-react-native-and_84.html和我在嘗試編譯iOS應用程序時遇到一些錯誤。SyntaxError:未終止的JSX內容
任何幫助?
這裏是我的代碼...
import React, {Component} from 'react';
import {ReactNative,
AppRegistry,
ListView,
StyleSheet,
ActionButton,
Text,
View,
TouchableHighlight,
AlertIOS } from 'react-native';
import * as firebase from 'firebase';
const StatusBar = require('./components/StatusBar');
const ActionButton = require('./components/ActionButton');
const ListItem = require('./components/ListItem');
const styles = require('./styles.js');
const {
} = ReactNative;
// Initialize Firebase
const firebaseConfig = {
apiKey: "******",
authDomain: "*****",
databaseURL: "******",
storageBucket: "******",
messagingSenderId: "******"
};
const firebaseApp = firebase.initializeApp(firebaseConfig);
class GroceryApp extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: new ListView.DataSource({
rowHasChanged: (row1, row2) => row1 !== row2,
})
};
}
componentDidMount() {
this.setState({
dataSource: this.state.dataSource.cloneWithRows([{ title: 'Pizza' }])
})
}
_renderItem(item) {
return (
<ListItem item={item} />
);
}
render() {
return (
<View style={styles.container}>
<StatusBar title="Grocery List">
<ListView
datasource={this.state.dataSource}
renderrow={this._renderItem.bind(this)}
style={styles.listview}
/>
<ActionButton title="Add" />
</View>
);
}
}
AppRegistry.registerComponent('GroceryApp',() => GroceryApp);
'' 需要關閉,像'' 我 –
peterp