Skip to content

Commit c743dc3

Browse files
yangshungaearon
authored andcommitted
Fix typo in reconciliation docs regarding uncontrolled inputs (reactjs#705)
1 parent 11c7124 commit c743dc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: content/docs/reconciliation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ When that's not the case, you can add a new ID property to your model or hash so
140140

141141
As a last resort, you can pass an item's index in the array as a key. This can work well if the items are never reordered, but reorders will be slow.
142142

143-
Reorders can also cause issues with component state when indexes are used as keys. Component instances are updated and reused based on their key. If the key is an index, moving an item changes it. As a result, component state for things like controlled inputs can get mixed up and updated in unexpected ways.
143+
Reorders can also cause issues with component state when indexes are used as keys. Component instances are updated and reused based on their key. If the key is an index, moving an item changes it. As a result, component state for things like uncontrolled inputs can get mixed up and updated in unexpected ways.
144144

145145
[Here](codepen://reconciliation/index-used-as-key) is an example of the issues that can be caused by using indexes as keys on CodePen, and [here](codepen://reconciliation/no-index-used-as-key) is a updated version of the same example showing how not using indexes as keys will fix these reordering, sorting, and prepending issues.
146146

0 commit comments

Comments
 (0)