React 生命周期函数

React 生命周期图示

一、组件挂载阶段(Mounting)

1、componentDidMount()
在组件创建好 dom 元素后,挂载进页面时调用

二、组件更新阶段(Updating)

1、static getDerivedStateFromProps()
2、shouldComponentUpdate()
3、componentDidUpdate()

三、组件卸载阶段(Unmounting)

1、componentWillUnmount()

posted @ 2019-08-10 17:33  Leophen  阅读(288)  评论(0编辑  收藏  举报