zoukankan
html css js c++ java
React的生命周期
React的生命周期
1. 挂载卸载过程
1.1.constructor()
1.2.componentWillMount()
1.3.componentDidMount()
1.4.componentWillUnmount ()
2. 更新过程
2.1. componentWillReceiveProps (nextProps)
2.2.shouldComponentUpdate(nextProps,nextState)
2.3.componentWillUpdate (nextProps,nextState)
2.4.componentDidUpdate(prevProps,prevState)
2.5.render()
3. React新增的生命周期
3.1. getDerivedStateFromProps(nextProps, prevState)
3.2. getSnapshotBeforeUpdate(prevProps, prevState)
这周开始学习React的生命周期。
React的生命周期从广义上分为三个阶段:挂载、渲染、卸载
因此可以把React的生命周期分为两类:挂载卸载过程和更新过程。
React的生命周期图:
查看全文
相关阅读:
读书笔记-js
读书笔记-设计模式
读书笔记-并发和多线程
读书笔记-泛型有限通配符
读书笔记-类和类加载器
项目: 推送水木文章到Kindle
项目:DoubleFaceCamera
项目:BluetoothChat
项目:简单记事本
项目: 连连看
原文地址:https://www.cnblogs.com/sunupo/p/15581084.html
最新文章
JSON对象和字符串之间的相互转换
jQuery日期联动插件
JSONObject
去掉svn与文件之间 的关联
(转)良好的代码习惯
(转)Java程序员应该了解的10个面向对象设计原则
(转)URI与URL的区别
nginx读取图片没有权限
(转)提高代码质量---one
soapui工具使用时400 Bad Request
热门文章
linshi_temp_erweima_html
linshi_temp_erweima_html_backup
(转)eclipse自动补全的设置
LED notification in Android device
How to tile small texture image onto page as its background
The Adapter of ListView: Just adapt data to view, don’t do anything else
Implement a TextView with an animation in its left side
Shape + Selector: Make a Shape as one item of the Selector
Units Problem: How to read text size as custom attr from xml and set it to TextView in java code
读书笔记-Android初学笔记
Copyright © 2011-2022 走看看