赞
踩
装载阶段
组件第一次被渲染时的阶段,这一阶段相关的生命周期函数有:
constructor
componentWillMount
render
componentDidMount
更新阶段
如果组件中的 state 或者 props 发生了改变,React 就会更新该组件,此时会调用更新阶段中相关的生命周期函数:
componentWillReceiveProps
shouldComponentUpdate
componentWillUpdate
render
componentDidUpdate
卸载阶段
componentWillUnmount
我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易,
但坚持一定很酷。欢迎大家一起讨论
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。