2019-01-03 生命周期

1.生命周期分为:

a)组件加载之前,组件加载完成(Mounting)

b)组件更新数据(Updating)

c)组件销毁(Unmounting)

在这过程中,会触发一系列的方法。

2.在组件加载的时候触发的函数:

constructor, componentWillMount, render, componentDidMount

3.组件更新数据的时候触发的函数:

shouldComponentUpdate, componentWillUpdate, render, componentDidUpdate

4.你在父组件里改变props传值的时候触发:

componentWillReceiveProps

5.组件销毁时触发:

componentWillUnmount




你可能感兴趣的:(2019-01-03 生命周期)