From 7968379f7ccd262a3c5fa95f7128abdd11dfda5c Mon Sep 17 00:00:00 2001 From: mimosapudical <153621177+mimosapudical@users.noreply.github.com> Date: Wed, 20 Aug 2025 18:43:24 +0800 Subject: [PATCH] Update choosing-the-state-structure.md --- src/content/learn/choosing-the-state-structure.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/learn/choosing-the-state-structure.md b/src/content/learn/choosing-the-state-structure.md index 5be2b4d346a..7069990fa9a 100644 --- a/src/content/learn/choosing-the-state-structure.md +++ b/src/content/learn/choosing-the-state-structure.md @@ -355,7 +355,7 @@ function Message({ messageColor }) { Here, a `color` state variable is initialized to the `messageColor` prop. The problem is that **if the parent component passes a different value of `messageColor` later (for example, `'red'` instead of `'blue'`), the `color` *state variable* would not be updated!** The state is only initialized during the first render. -This is why "mirroring" some prop in a state variable can lead to confusion. Instead, use the `messageColor` prop directly in your code. If you want to give it a shorter name, use a constant: +This is why “mirroring” some prop in a state variable can lead to confusion. Instead, use the `messageColor` prop directly in your code. If you want to give it a shorter name, use a constant: ```js function Message({ messageColor }) { @@ -364,7 +364,7 @@ function Message({ messageColor }) { This way it won't get out of sync with the prop passed from the parent component. -"Mirroring" props into state only makes sense when you *want* to ignore all updates for a specific prop. By convention, start the prop name with `initial` or `default` to clarify that its new values are ignored: +“Mirroring” props into state only makes sense when you *want* to ignore all updates for a specific prop. By convention, start the prop name with `initial` or `default` to clarify that its new values are ignored: ```js function Message({ initialColor }) {