老版本
挂载时
constructor()
componentWillMount()
render()
componentDidMount()
更新时
componentWillReceiveProps()
shouldComponentUpdate()
componentWillUpdate()
render()
componentDidUpdate()
卸载时
componentWillUnmount()
新版本(16.3开始)
挂载时
constructor()
static getDerivedStateFromProps()
render()
componentDidmount()
更新时
static getDerivedStateFromProps()
shouldComponetUpdate()
render()
getSnapshotBeforeUpdate()
componentDidUpdate()
卸载时
componentWilUnmount()