constructor
static getDerivedStateFromProps
替换componentWillReceiveProps,返回一个新的state,不用更新放回null
componentWillMount
将要废弃,推荐写道constructor里面去
render
componentDidMount
componentWillReceiveProps
将要废弃
shouldComponentUpdate
componentWillUpdate
将要废弃
getSnapshotBeforeUpdate(prevProps, prevState)
替换componentWillUpdate,返回的内容作为componentDidUpdate的第三个参数