Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siddtheone
Copy link

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.

## 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.
Copy link

vercel bot commented Feb 23, 2025

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

Copy link

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! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants