react.dev
react.dev copied to clipboard
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 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.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| 19-react-dev | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 23, 2025 11:26am |
| react-dev | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 23, 2025 11:26am |
Size changes
📦 Next.js Bundle Analysis for react-dev
This analysis was generated by the Next.js Bundle Analysis action. 🤖
This PR introduced no changes to the JavaScript bundle! 🙌