1. 挂载
当组件实例被创建并插入 DOM 节点时,其生命周期调用顺序如下:
“注意:
- constructor()
- static getDerivedStateFromProps()
- render()
- componentDidMount()
2. 更新
当组件的 state 或者 props 变化时会触发更新,此时生命周期调用顺序如下:
“注意:
- static getDerivedStateFromProps()
- shouldComponentUpdate()
- render()
- getSnapshotBeforeUpdate()
- componentDidUpdate()
3. 卸载
当组件从 DOM 中移除时会调用如下方法:
“注意:
- componentWillUnmount()
4. 错误处理
当渲染过程,生命周期,或子组件的构造函数中抛出错误时,会调用如下方法:
“注意:
- static getDerivedStateFromError()
- componentDidCatch()
常用周期函数

包含不常用周期函数
