From d3a283cbe26622eec3003bf0ed6dcb52b87d4e29 Mon Sep 17 00:00:00 2001 From: mdimamhosen Date: Wed, 2 Sep 2026 15:55:44 +0600 Subject: [PATCH 1/2] docs: clarify repetitive phrasing in Preserving and Resetting State Fixes reactjs/react.dev#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 --- src/content/learn/preserving-and-resetting-state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/preserving-and-resetting-state.md b/src/content/learn/preserving-and-resetting-state.md index 685f63ef4ae..6be57a2b4c3 100644 --- a/src/content/learn/preserving-and-resetting-state.md +++ b/src/content/learn/preserving-and-resetting-state.md @@ -478,7 +478,7 @@ label { You might expect the state to reset when you tick checkbox, but it doesn't! This is because **both of these `` 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. -In both cases, the `App` component returns a `
` with `` 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. +In both cases, the `App` component returns a `
` with `` as a first child. To React, these two counters have the same "address": they're both the first child of the `
` that `App` returns. This is how React matches them up between the previous and next renders, regardless of how you structure your logic. From ec80907c0803debaad6089728ef379790fec0e83 Mon Sep 17 00:00:00 2001 From: Imam Hosen <119607102+mdimamhosen@users.noreply.github.com> Date: Wed, 2 Sep 2026 16:53:00 +0600 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/content/learn/preserving-and-resetting-state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/preserving-and-resetting-state.md b/src/content/learn/preserving-and-resetting-state.md index 6be57a2b4c3..5e0923079da 100644 --- a/src/content/learn/preserving-and-resetting-state.md +++ b/src/content/learn/preserving-and-resetting-state.md @@ -478,7 +478,7 @@ label { You might expect the state to reset when you tick checkbox, but it doesn't! This is because **both of these `` 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. -In both cases, the `App` component returns a `
` with `` as a first child. To React, these two counters have the same "address": they're both the first child of the `
` that `App` returns. This is how React matches them up between the previous and next renders, regardless of how you structure your logic. +In both cases, the `App` component returns a `
` with `` as the first child. To React, these two counters have the same "address": they're both the first child of the `
` that `App` returns. This is how React matches them up between the previous and next renders, regardless of how you structure your logic.