Created
December 10, 2018 17:37
-
-
Save sashadev-sky/2e5dd651f4a0894aa47b1c3d8a4e0e43 to your computer and use it in GitHub Desktop.
The Life-Cycle of a Composite Component
This file contains hidden or 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
/** | |
* ------------------ The Life-Cycle of a Composite Component ------------------ | |
* | |
* - constructor: Initialization of state. The instance is now retained. | |
* - componentWillMount() | |
* - render() | |
* - [children's constructors] | |
* - [children's componentWillMount and render] | |
* - [children's componentDidMount] | |
* - componentDidMount() | |
* | |
* Update Phases: | |
* - componentWillReceiveProps(nextProps) *only called if parent updated* | |
* - shouldComponentUpdate(nextProps, nextState) | |
* - componentWillUpdate(nextProps, nextState) | |
* - render() | |
* - [children's constructors or receive props phases] | |
* - componentDidUpdate(prevProps, prevState) | |
* | |
* - componentWillUnmount() | |
* - [children's componentWillUnmount] | |
* - [children destroyed] | |
* - (destroyed): The instance is now blank, released by React and ready for GC. | |
* | |
* ----------------------------------------------------------------------------- | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment