react.dev
react.dev copied to clipboard
Update queueing-a-series-of-state-updates.md
trafficstars
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 likesetNumber(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.