Skip to content

docs: wrap state updates after await in startTransition#8443

Open
Dotify71 wants to merge 1 commit into
reactjs:mainfrom
Dotify71:fix/issue-7444-start-transition-await
Open

docs: wrap state updates after await in startTransition#8443
Dotify71 wants to merge 1 commit into
reactjs:mainfrom
Dotify71:fix/issue-7444-start-transition-await

Conversation

@Dotify71
Copy link
Copy Markdown

Fixes #7444

Under React 19 concurrent rendering, state updates that happen after an await statement inside a startTransition or useTransition callback are not automatically treated as transitions. To ensure they are handled properly and don't prematurely dismiss loading indicators (isPending), they must be wrapped in a nested startTransition call.

This PR updates the example code in server-functions.md and use-server.md to reflect this behavior, keeping them consistent with other startTransition examples in the documentation.

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

[Typo]: example code contradicts other startTransition examples

1 participant