Skip to content

Commit 605f572

Browse files
authored
Clarify distinction between local and internal state references
1 parent a1ddcf5 commit 605f572

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/content/learn/state-as-a-snapshot.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ label, textarea { margin-bottom: 10px; display: block; }
6464
Here's what happens when you click the button:
6565

6666
1. The `onSubmit` event handler executes.
67-
2. `setIsSent(true)` sets `isSent` to `true` and queues a new render.
67+
2. `setIsSent(true)` sets `isSent`<sup>*</sup> to `true` and queues a new render.
6868
3. React re-renders the component according to the new `isSent` value.
6969

70+
<sup>*</sup> Note that only the `isSent` value stored within React's state manager is updated. The local component variable `isSent` does not change as it is a _copy of_ not a _reference to_ the internal state
71+
7072
Let's take a closer look at the relationship between state and rendering.
7173

7274
## Rendering takes a snapshot in time {/*rendering-takes-a-snapshot-in-time*/}

0 commit comments

Comments
 (0)