React生命周期
.1. 挂载
- componentWillMount
- componentDidMount
2. 更新 - componentWillReceiveProps
- shouldComponentUpdate
- componentWillUpdate
- componentDidUpdate
3. 卸载 - componentWillUnmount
新的生命周期
1. 挂载
8. getDerivedStateFromProps
9. componentDidMount
2. 更新
10. getDerivedStateFromProps
11. shouldComponentUpdate
12. getSnapshotBeforeUpdate
13. componentDidUpdate
3. 卸载
- componentWillUnmount