Skip to content

Commit d3a283c

Browse files
docs: clarify repetitive phrasing in Preserving and Resetting State
Fixes #8622 Replace awkward "first child of the first child of the root" wording with a clearer description of where React sees the Counter in the tree. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 24618e2 commit d3a283c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/content/learn/preserving-and-resetting-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ label {
478478

479479
You might expect the state to reset when you tick checkbox, but it doesn't! This is because **both of these `<Counter />` tags are rendered at the same position.** React doesn't know where you place the conditions in your function. All it "sees" is the tree you return.
480480

481-
In both cases, the `App` component returns a `<div>` with `<Counter />` as a first child. To React, these two counters have the same "address": the first child of the first child of the root. This is how React matches them up between the previous and next renders, regardless of how you structure your logic.
481+
In both cases, the `App` component returns a `<div>` with `<Counter />` as a first child. To React, these two counters have the same "address": they're both the first child of the `<div>` that `App` returns. This is how React matches them up between the previous and next renders, regardless of how you structure your logic.
482482

483483
</Pitfall>
484484

0 commit comments

Comments
 (0)