Life Cycle Flow
Last updated
Was this helpful?
Last updated
Was this helpful?
The React development team provides a series of hooks we can tap into at each phase of the life cycle. These method hooks inform us of where the Component is in the life cycle and what we can and cannot do.
Each of the life cycle methods are called in a specific order and at a specific time. The methods are also tied to different parts of the life cycle. Here are the methods broken down in order and by their corresponding life cycle phase :
Initialize / Construction
getDefaultProps()
(React.createClass) or MyComponent.defaultProps
(ES6 class)
getInitialState()
(React.createClass) or this.state = ...
(ES6 constructor)
componentWillMount()
deprecated
render()
Children initialization & life cycle kickoff
componentDidMount()
componentWillReceiveProps()
deprecated
shouldComponentUpdate()
componentWillUpdate()
deprecated
render()
Children Life cycle methods
componentDidUpdate()
componentWillUnmount()
Children Life cycle methods
Instance destroyed for Garbage Collection
The order of these methods are strict and called as defined above. Most of the time is spent in the Growth/Update phase and those methods are called many times. The Birth and Death methods will only be called once.