新版钩子
mounting:
constructor
getDerivedStateFromProps
render
componentDidMount
updation:
getDerivedStateFromProps
shouldComponentUpdate
render
getSnapshotBeforeUpdate
componentDidUpdate
unmounting:
componentWillUnmount
以下是老版和新版钩子对比图
实际开发中常用到的钩子并不多


高阶组件的理解
高阶组件是一个组件传入另一个组件,对传入的组件做提升,增加对这个组件复用的功能
context ,react 官方不推荐使用这个,但是 redux 和 mobx 都是基于 context