We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cc8df55 + c573d35 commit 7c723c5Copy full SHA for 7c723c5
README.md
@@ -147,7 +147,7 @@ react的diff算法用在什么地方呢?当组件更新的时候,react会创
147
> react性能优化非常重要的一环。组件接受新的state或者props时调用,我们可以设置在此对比前后两个props和state是否相同,如果相同则返回false阻止更新,因为相同的属性状态一定会生成相同的dom树,这样就不需要创造新的dom树和旧的dom树进行diff算法对比,节省大量性能,尤其是在dom结构复杂的时候。不过调用this.forceUpdate会跳过此步骤。
148
149
150
- **8、componentWillUpdata(nextProps, nextState)**
+ **8、componentWillUpdate(nextProps, nextState)**
151
> 组件初始化时不调用,只有在组件将要更新时才调用,此时可以修改state
152
153
0 commit comments