脚本宝典收集整理的这篇文章主要介绍了React V16.3生命周期:The Component Lifecycle Flowchart,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
学习React
免不了对组件生命周期的学习,我们应该掌握最新生命周期,学以致用,以达到性能优化的目的。
The component Lifecycle
React Version: 16.3
1 生命周期可视化
2 简要总结:
- 去掉了3个方法
componentWillMount
componentWillReceiveProps
componentWillUpdate
- 增加了2个方法
- 更改了1个方法,增加了第3个参数
componentDidUpdate(prevProps, prevState, snapshot)
- 更改原因:
官网说是为了实现将来新版本的异步渲染In order to support async rendering
最后
官网文档: https://reactjs.org/docs/react-component.html#static-getderivedstatefromprops
以上是脚本宝典为你收集整理的React V16.3生命周期:The Component Lifecycle Flowchart全部内容,希望文章能够帮你解决React V16.3生命周期:The Component Lifecycle Flowchart所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。