Skip to content

Commit 7c723c5

Browse files
authored
Merge pull request bailicangdu#35 from nuty/patch-2
Update README.md
2 parents cc8df55 + c573d35 commit 7c723c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ react的diff算法用在什么地方呢?当组件更新的时候,react会创
147147
> react性能优化非常重要的一环。组件接受新的state或者props时调用,我们可以设置在此对比前后两个props和state是否相同,如果相同则返回false阻止更新,因为相同的属性状态一定会生成相同的dom树,这样就不需要创造新的dom树和旧的dom树进行diff算法对比,节省大量性能,尤其是在dom结构复杂的时候。不过调用this.forceUpdate会跳过此步骤。
148148
149149

150-
**8、componentWillUpdata(nextProps, nextState)**
150+
**8、componentWillUpdate(nextProps, nextState)**
151151
> 组件初始化时不调用,只有在组件将要更新时才调用,此时可以修改state
152152
153153

0 commit comments

Comments
 (0)