Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cheatsheet for React lifecycle and update cycle methods
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
@nevinm
Copy link

nevinm commented Sep 25, 2016

Could you also add where the DOM mutations are best to be done. Also where the state shouldn't be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment