React 生命周期函数

叁歲伎倆 2023-06-02 09:17 138阅读 0赞

React v16.4 生命周期图示

1731684-20190810171825486-293040245.png

一、组件挂载阶段(Mounting)

1、constructor()

2、static getDerivedStateFromProps()

3、render()

4、componentDidMount()

二、组件更新阶段(Updating)

1、static getDerivedStateFromProps()

2、shouldComponentUpdate()

3、render()

4、getSnapshotBeforeUpdate()

5、componentDidUpdate()

#

三、组件卸载阶段(Unmounting)

1、componentWillUnmount()

转载于:https://www.cnblogs.com/Leophen/p/11332362.html

发表评论

表情:
评论列表 (有 0 条评论,138人围观)

还没有评论,来说两句吧...

相关阅读