生命周期分三个阶段:
创建阶段(Mounting)、更新阶段(Updating)、卸载阶段(Unmounting)
Mounting
constructor()
static getDerivedStateFromProps()
componentWillMount()
render()
componentDidMount()
Update
componentWillReceiveProps()
statice getDerivedStateFromProps()
shouldComponentUpdate()
componentWillUpdate()
render()
getSnapshotBeforeUpdate()
componentDidUpdate()
Unmouting
componentWillUnmount()
componentDidCatch()