Flesh it out a little
This commit is contained in:
parent
d305f7c763
commit
f077346449
BIN
Lifecycle-chart.jpg
Normal file
BIN
Lifecycle-chart.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 111 KiB |
30
README.md
30
README.md
@ -1,3 +1,33 @@
|
|||||||
# React-Lifecycle-Cheatsheet
|
# React-Lifecycle-Cheatsheet
|
||||||
|
|
||||||
Short reference of React.Component lifecycle methods so I don't have to scroll through the huge text on the official documentation
|
Short reference of React.Component lifecycle methods so I don't have to scroll through the huge text on the official documentation
|
||||||
|
|
||||||
|
![Lifecycle Diagram](./Lifecycle-chart.jpg)
|
||||||
|
|
||||||
|
## Mounting
|
||||||
|
|
||||||
|
### constructor ()
|
||||||
|
|
||||||
|
```
|
||||||
|
/**
|
||||||
|
* Create state and call super
|
||||||
|
*
|
||||||
|
* @param {object} props
|
||||||
|
*/
|
||||||
|
constructor (props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
foo: 'bar'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### static getDerivedStateFromProps ()
|
||||||
|
|
||||||
|
## Updating
|
||||||
|
|
||||||
|
### shouldComponentUpdate ()
|
||||||
|
|
||||||
|
## Unmounting
|
||||||
|
|
||||||
|
### componentWillUnmount ()
|
Loading…
Reference in New Issue
Block a user