Skip to content

Commit 5c9f2ad

Browse files
authored
Update queueing-a-series-of-state-updates.md
## Update React Docs: State Updater Function Example ### Summary This PR improves the clarity of the documentation regarding the use of state updater functions in React. The previous wording was slightly ambiguous, and this revision makes the explanation more precise. ### Changes - Updated the sentence: **Before:** "To update some state multiple times in one event, you can use `setNumber(n => n + 1)` updater function." **After:** "To update some state multiple times in one event, you can use an updater function like `setNumber(n => n + 1)`." ### Rationale - Introduces **"an updater function"** before the example for better readability. - Ensures consistency with React documentation standards. - Improves comprehension for new developers.
1 parent fc29603 commit 5c9f2ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/learn/queueing-a-series-of-state-updates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ If you prefer more verbose code, another common convention is to repeat the full
264264

265265
* Setting state does not change the variable in the existing render, but it requests a new render.
266266
* React processes state updates after event handlers have finished running. This is called batching.
267-
* To update some state multiple times in one event, you can use `setNumber(n => n + 1)` updater function.
267+
* To update some state multiple times in one event, you can use an updater function like `setNumber(n => n + 1)`.
268268

269269
</Recap>
270270

@@ -600,4 +600,4 @@ Now you know how this part of React works!
600600

601601
</Solution>
602602

603-
</Challenges>
603+
</Challenges>

0 commit comments

Comments
 (0)