this.setState
内fetch
成功无效。
以下是代码:
fetch(url)
.then(response = > response.json())
.then(json = >
{
var data = json.data;
alert(data);
this.setState(
{
userData: data,
dataSource: this.state.dataSource.cloneWithRows(userData)
})
})
.catch (() = >
{
alert('ERROR GETTING DATA FROM FACEBOOK');
})