Skip to content

Clarify useActionState async non-transition warning#32207

Merged
sophiebits merged 1 commit intofacebook:mainfrom
sophiebits:uas
Jan 24, 2025
Merged

Clarify useActionState async non-transition warning#32207
sophiebits merged 1 commit intofacebook:mainfrom
sophiebits:uas

Conversation

@sophiebits
Copy link
Copy Markdown
Collaborator

@sophiebits sophiebits commented Jan 23, 2025

@react-sizebot
Copy link
Copy Markdown

Comparing: ae9017ceabb2a36a04c249ad5342e0b1af3e1a54...598f10bce1e3730ddc64ffeba36bf12a6dd61232

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 514.24 kB 514.24 kB = 91.73 kB 91.73 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 557.28 kB 557.28 kB = 98.97 kB 98.97 kB
facebook-www/ReactDOM-prod.classic.js = 595.79 kB 595.79 kB = 104.85 kB 104.85 kB
facebook-www/ReactDOM-prod.modern.js = 586.21 kB 586.21 kB = 103.30 kB 103.30 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 6a31e33

'`action` prop, or dispatch manually inside `startTransition`',
'An async function with useActionState was called outside of a transition. ' +
'This is likely not what you intended (for example, isPending will not update ' +
'correctly). Either call the returned function inside startTransition, or pass it ' +
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"dispatch manually" vs new "call the returned function" is much clearer 👍🏻

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

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants