We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 566e910 + 3c8c752 commit 9c30868Copy full SHA for 9c30868
content/docs/lists-and-keys.md
@@ -119,7 +119,7 @@ const todoItems = todos.map((todo, index) =>
119
);
120
```
121
122
-我們並不建議你使用索引作為 key,尤其如果項目的順序會改變的話。這會對效能產生不好的影響,也可能會讓 component state 產生問題。請參考 Robin Pokorny 這篇[深入剖析使用索引作為 key 的負面效應](ttps://robinpokorny.com/blog/index-as-a-key-is-an-anti-pattern/)ㄧ文。如果你選擇不明確分配 key 到列表項目時,React 預設將會使用索引作為 key。
+我們並不建議你使用索引作為 key,尤其如果項目的順序會改變的話。這會對效能產生不好的影響,也可能會讓 component state 產生問題。請參考 Robin Pokorny 這篇[深入剖析使用索引作為 key 的負面效應](https://robinpokorny.com/blog/index-as-a-key-is-an-anti-pattern/)ㄧ文。如果你選擇不明確分配 key 到列表項目時,React 預設將會使用索引作為 key。
123
124
如果你想了解更多,請參考[深度剖析 key 的必要性](/docs/reconciliation.html#recursing-on-children)一文。
125
0 commit comments