阶段划分:
初始化阶段:主要执行 constructor、componentWillMount()、render()、componentDidMount()等。组件这时候还没有被创建起来。
更新阶段:props或state的改变可能会引起组件的更新,组件重新渲染的过程中会调用以下方法,componentWillUpdate()、render()、componentDidUpdate()等。
卸载阶段:componentWillUnmount()
中间件阶段:错误处理,componentDidCatch()