Skip to content

docs: clarify that useState setter triggers a re-render in Quick Start - #8656

Open
tirthraj01 wants to merge 1 commit into
reactjs:mainfrom
tirthraj01:docs/clarify-usestate-rerender
Open

docs: clarify that useState setter triggers a re-render in Quick Start#8656
tirthraj01 wants to merge 1 commit into
reactjs:mainfrom
tirthraj01:docs/clarify-usestate-rerender

Conversation

@tirthraj01

Copy link
Copy Markdown

Description

In the "Updating the screen" section of the Quick Start guide, useState is introduced with a counter button example. The guide calls setCount(count + 1) and immediately follows with stating that React will call the component function again, without explicitly mentioning that calling the state setter triggers a re-render.

This PR adds a concise sentence explaining that calling the setter function tells React that state has changed and triggers a re-render, clarifying why the component function is re-executed for readers transitioning from plain JavaScript.

Closes #8655

How was this tested?

  • Verified that the explanation reads naturally in context.
  • Checked git diff to ensure no unrelated markdown or formatting changes were made.

@github-actions

Copy link
Copy Markdown

Size changes

Details

📦 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: improve useState explanation in quick start

1 participant