Skip to content

Conversation

@DeveloperViraj
Copy link

Closes #8158

Fix incorrect startTransition usage in docs

The example in the Server Functions page calls a server action inside startTransition, but the state updates after the await aren’t wrapped in a new transition. React’s docs mention that post-await state updates aren’t included automatically, so this updates the snippet to wrap them in another startTransition for correctness.

This brings the example in line with the recommended behavior.

@github-actions
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.

Is this demo in the React doc an incorrect usage of startTransition?

1 participant