初始化
initialzation 组件初始化(constructor也属于一个生命周期函数):初始化数据 state and props
Mounting
componentWillMount:在组件即将被挂载到页面的时刻,自动执行。
render:页面渲染。
componentDidMount:在组件即将被挂载到页面之后,自动执行。(只执行一次,所以将ajax放在这里最合适)
updation(组件更新)
componentWillReceiveProps:首先这个函数要从父组件接收一个参数,并且如果这个组件第一次存在于父组件中不会被执行,如果已经存在于父组件中就会被执行。
shouldcomponentUpdate:组件即将被更新的时候,自动执行,返回一个布尔值,如果返回flase,则后面的生命周期函数都不会被执行。
componentWillupdate:组件被更新之前,自动执行,shouldcomponentUpdate返回true则执行。
render:页面渲染。
Unmounting (组件卸载)
componentWillUnmount:组件即将被页面卸载时被执行。
779

被折叠的 条评论
为什么被折叠?



