Skip to content

Commit

Permalink
docs(cn): optimized translation reconciliation.md (reactjs#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
aspojo authored May 30, 2022
1 parent 57274d0 commit 48966ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/reconciliation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ React 提供的声明式 API 让开发者可以在对 React 的底层实现并
如果在 React 中使用该算法,那么展示 1000 个元素则需要 10 亿次的比较。这个开销实在是太过高昂。于是 React 在以下两个假设的基础之上提出了一套 O(n) 的启发式算法:

1. 两个不同类型的元素会产生出不同的树;
2. 开发者可以通过设置 `key` 属性,来告知渲染哪些子元素在不同的渲染下可以保存不变;
2. 开发者可以使用 `key` 属性标识哪些子元素在不同的渲染中可能是不变的。

在实践中,我们发现以上假设在几乎所有实用的场景下都成立。

Expand Down

0 comments on commit 48966ce

Please sign in to comment.