Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/content/learn/state-as-a-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ label, textarea { margin-bottom: 10px; display: block; }
Here's what happens when you click the button:

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

<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

Let's take a closer look at the relationship between state and rendering.

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