挂载
- construct()
- static getDerivedStateFromProps()
- render()
- componentDidMount()
不建议使用:componentWillMount()
更新
- static getDerivedStateFromProps()
- shouldComponentUpdate()
- render()
- getSnapshotBeforeUpdate()
- componentDidUpdate()
不建议使用:componentWillUpdate()、componentWillReceiveProps()
卸载
错误处理
- static getDerivedStateFromError()
- componentDidCatch()
其他APIs
class属性
实例属性
了解一下react的一些钩子函数
原文:https://www.cnblogs.com/let423/p/11973876.html