Created
May 2, 2017 10:34
-
-
Save barneycarroll/0020cde7d7b4c2f23ff84d1a9868a4ca to your computer and use it in GitHub Desktop.
React is irritating https://facebook.github.io/react/docs/state-and-lifecycle.html
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() { | |
fetchPosts().then(({posts}) => { | |
this.setState({posts}); | |
}); | |
fetchComments().then(({comments}) => { | |
this.setState({comments}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment