Skip to content

Instantly share code, notes, and snippets.

@laere
Created February 6, 2016 17:13
Show Gist options
  • Save laere/5f43e19bddf44dd10736 to your computer and use it in GitHub Desktop.
Save laere/5f43e19bddf44dd10736 to your computer and use it in GitHub Desktop.
componentDidMount: function() {
fetch('http://swapi.co/api/people')
.then(function(response) {
return response.json
})
.then(function(json) {
this.setState({ people: json });
}.bind(this))
.catch(function(err) {
console.log(err);
})
console.log(this.state.people);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment