首页 > 其他 > 详细

react 的生命周期函数

时间:2018-10-16 22:29:18      阅读:187      评论:0      收藏:0      [点我收藏+]

生命周期函数:

是指在某一时刻组件自动执行 的函数

初始化:

设置props和state

mounting:

componentWillMount 在组件即将被挂载到页面的时候自动执行

render 组件在页面上进行挂载

componentDidMount 在组件被挂载到页面的时候后自动执行

updation:组件更新

props

=>componentWillPeceiveProps=>shouldComponentUpdate=> componentWillUpdate=>render=> componentDidUpdate

 

state

=>shouldComponentUpdate=> componentWillUpdate=>render=> componentDidUpdate

 

unmounting:

即将被从页面去除组件的时候

react 的生命周期函数

原文:https://www.cnblogs.com/guangzhou11/p/9801083.html

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