【文件属性】:
文件名称:React-LifeCycles-DeepDive:深入研究React组件的生命周期
文件大小:63KB
文件格式:ZIP
更新时间:2021-05-01 18:15:54
react reactjs react-components react-life-cycle react-life-cycle-demo
React组件生命周期深入研究
组件生命周期方法
安装
当创建组件实例并将其插入DOM时,将调用以下方法:
构造函数()
静态getDerivedStateFromProps()
componentWillMount()
使成为()
componentDidMount()
更新中
更新可能是由道具或状态的更改引起的。 当重新渲染组件时,将调用以下方法:
componentWillReceiveProps()
静态getDerivedStateFromProps()
shouldComponentUpdate()
componentWillUpdate()
使成为()
getSnapshotBeforeUpdate()
componentDidUpdate()
正在卸载
从DOM中删除组件时,将调用此方法:
componentWillUnmount()
错误处
【文件预览】:
React-LifeCycles-DeepDive-master
----style()
--------main.css(0B)
----package.json(781B)
----index.html(265B)
----src()
--------index.js(272B)
--------components()
----.gitignore(12B)
----webpack.config.js(556B)
----README.md(1KB)
----yarn.lock(206KB)
----LICENSE.MD(1KB)