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

docs: fix incorrect startTransition usage in server-functions example

Open DeveloperViraj opened this issue 1 month ago • 1 comments

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.

DeveloperViraj avatar Nov 24 '25 13:11 DeveloperViraj

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

github-actions[bot] avatar Nov 24 '25 13:11 github-actions[bot]