- constructor()
- static getDerivedStateFromProps(props, state) :object|null #
初次渲染和后续更新都会调用,返回对象更新state或返回null不作任何更新 - shouldComponentUpdate():boolean
- render()
- getSnapshotBeforeUpdate(prevProps, prevState): any|null # 最近一次渲染输出调之前用,可传递参数(snapshot )到componentDidUpdate
- componentDidMount()
- componentDidUpdate(prevProps, prevState, snapshot)
- componentWillUnmount()
当渲染过程,生命周期,或子组件的构造函数中抛出错误时,会调用如下方法:
- static getDerivedStateFromError()
-
componentDidCatch()
生命周期.png
