Created
February 6, 2016 17:13
-
-
Save laere/5f43e19bddf44dd10736 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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