react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

Update queueing-a-series-of-state-updates.md

Open siddtheone opened this issue 8 months ago • 2 comments
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 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.

siddtheone avatar Feb 23 '25 11:02 siddtheone