React-Native için çok yeni. Temel React-Native öğreticisini izleyerek JSON verilerini "https://facebook.github.io/react-native/movies.json" dan almaya çalışıyorum. Ben title
ve description
özelliklerini görüntüleyebilir ama çalıştığımda aşağıdaki hatayı alıyorum bir ListView
kullanarak "filmler" özelliğini görüntülemek için:undefined bir nesne değildir ('allRowsIDs.length' değerlendiriliyor) (React-Native)
undefined is not an object (evaluating 'allRowsIDs.length')
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
ListView
} from 'react-native';
var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
export default class AwesomeProject extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: 'init',
};
}
componentWillMount() {
fetch('https://facebook.github.io/react-native/movies.json')
.then((response) => response.json())
.then((responseJson) => {
this.setState({ dataSource: ds.cloneWithRows(responseJson.movies) });
})
.catch((error) => {
console.error(error);
});
}
render() {
return (
<View style={styles.container}>
<ListView
dataSource={this.state.dataSource}
renderRow={(rowData) => <Text>{rowData}</Text>}
/>
</View>
);
}
}
çalıştı, çok teşekkür ederiz! – rnboi05
O zaman muhtemelen doğru olarak işaretlemelisiniz ;-) –