Created
May 5, 2015 18:38
-
-
Save fisherwebdev/8f6cb895348c587c8f1e to your computer and use it in GitHub Desktop.
Cheatsheet for React lifecycle and update cycle methods
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
Lifecycle: | Update: | |
Mounting and Unmounting | New Props or State | |
--------------------------------+----------------------------------- | |
| | |
getDefaultProps() | componentWillReceiveProps()* | |
| | |
getInitialState() | shouldComponentUpdate() | |
| | |
componentWillMount() | componentWillUpdate() | |
| | |
render() | render() | |
| | |
----------------------- DOM Mutations Complete ---------------------- | |
| | |
componentDidMount() | componentDidUpdate() | |
| | |
--------------------------------| | |
| | |
componentWillUnmount() | | |
| | |
--------------------------------+------------------------------------ | |
*Called only with new props |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you also add where the DOM mutations are best to be done. Also where the state shouldn't be updated.