componentWillMount()
componentDidMount()
componentWillUpdate(object nextProps, object nextState)
componentDidUpdate(object prevProps, object prevState)
componentWillUnmount()
componentWillReceiveProps(object nextProps)
shouldComponentUpdate(object nextProps, object nextState)
希望大家能不吝啬说一两点,我学习一下
componentDidMount
常用来在组件加载完毕后 网络请求数据是使用
componentWillUnmount
组件死的时候调用,一般用来清除监听之类的
componentWillReceiveProps
传入新的props是调用
其它的几个我用的就不是太多了,这些生命周期用的最多的地方一般都是传参时使用比较多