首页 > 其他 > 详细

react生命周期

时间:2021-08-13 14:51:42      阅读:17      评论:0      收藏:0      [点我收藏+]
总的来说 React 组件的生命周期有三种状态

1、mounting: 插入真实 DOM //渲染前后
2、updating: 正在被重新渲染 props 或 state 改变 //更新前后
3、unmounting: 卸载 移除真实 DOM  //卸载前后
mounting 对应的函数
constructor()
componentWillMount()
render()
componentDidMount()
updating 对应的函数

componentWillReceiveProps()
shouldComponentUpdate()
componentWillUpdate()
render()
componentDidUpdate()
unmounting 对应的函数
componentWillUnmount()

 

react生命周期

原文:https://www.cnblogs.com/dongxiaolei/p/15136160.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!