Skip to content

Instantly share code, notes, and snippets.

@ysyun
Forked from fisherwebdev/React Lifecycle Methods
Created February 6, 2018 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysyun/5619e054b03e4411566a911192ec1a45 to your computer and use it in GitHub Desktop.
Save ysyun/5619e054b03e4411566a911192ec1a45 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment