I have this piece of code
componentWillMount() {
return fetch("http://10.0.3.2:8080/all", {
method: "GET",
headers: {
Accept: "application/json",
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(responseData => {
this.ds = new ListView.DataSource({
rowHasChanged: (r1, r2) => r1 !== r2
});
this.setState({
dataSource: this.ds.cloneWithRows(responseData)
});
})
.catch(error => {
console.log("error : " + error);
});
};
It brings me the data from my api, i already test it with console.log(this.state.dataSource) and the result was
console.log result
But when i add the code
<ListView
dataSource={this.state.dataSource}
renderRow={(rowData, navi) => this.renderEvent(rowData, this.props.nav)}
/>
I receive this error Error