1. 挂载卸载过程
constructor()
componentWillMount()
render()
componentDidMount()
componentWillUnmount ()
2. 更新过程
componentWillReceiveProps (nextProps) (写在组件的)
shouldComponentUpdate(nextProps,nextState)
componentWillUpdate (nextProps,nextState)
render()
componentDidUpdate(prevProps,prevState)

参考文档:https://www.jianshu.com/p/b331d0e4b398
测试:https://www.runoob.com/react/react-component-life-cycle.html
浙公网安备 33010602011771号