Skip to content

Instantly share code, notes, and snippets.

@edencakir
Created March 4, 2017 13:27
Show Gist options
  • Save edencakir/a8cf2eaabaca624e75f785b589cd8977 to your computer and use it in GitHub Desktop.
Save edencakir/a8cf2eaabaca624e75f785b589cd8977 to your computer and use it in GitHub Desktop.
getDataFromServer() {
fetch('http://178.211.49.209:9000/api/getEverything')
.then(response => response.json())
.then(responseJson => {
console.log('fetched data', responseJson);
this.setState({dataSource: ds.cloneWithRows(responseJson.response.categories)});
}).catch(error => console.log(error));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment