Skip to content

[flags] Enable conditional use() warning in React's Canary builds - #37491

Merged
eps1lon merged 1 commit into
mainfrom
sebbie/conditional-use-canary
Sep 2, 2026
Merged

[flags] Enable conditional use() warning in React's Canary builds#37491
eps1lon merged 1 commit into
mainfrom
sebbie/conditional-use-canary

Conversation

@eps1lon

@eps1lon eps1lon commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

The warning was previously only enabled for experimental builds (react@experimental). This enables the warning for react@canary as well.

Keep in mind that conditional use() is generally supported. This warning only triggers if the condition is based on promise.status (or promise.value). Let use() handle that status. React will not suspend if the promise.status is already 'fulfilled'.

More information can be found in the use() docs under "Don’t skip calling use based on whether a Promise is already settled.".

We've tested this at Vercel on the latest version of SWR (which previously had conditional use() calls) and found no false-positive warnings or excessive warnings.

@meta-cla meta-cla Bot added the CLA Signed label Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Comparing: 33b4555...afe3496

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 = 7.35 kB 7.35 kB -0.10% 1.96 kB 1.96 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 625.29 kB 625.29 kB = 110.54 kB 110.53 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 7.36 kB 7.36 kB -0.10% 1.97 kB 1.96 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 696.51 kB 696.51 kB = 121.97 kB 121.97 kB
facebook-www/ReactDOM-prod.classic.js = 716.36 kB 716.36 kB = 125.38 kB 125.38 kB
facebook-www/ReactDOM-prod.modern.js = 706.67 kB 706.67 kB = 123.81 kB 123.81 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js +0.23% 698.57 kB 700.20 kB +0.36% 111.03 kB 111.42 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js +0.23% 698.65 kB 700.28 kB +0.36% 111.05 kB 111.45 kB
oss-stable-semver/react-art/cjs/react-art.development.js +0.23% 704.41 kB 706.05 kB +0.38% 111.26 kB 111.68 kB
oss-stable/react-art/cjs/react-art.development.js +0.23% 704.49 kB 706.12 kB +0.38% 111.28 kB 111.70 kB

Generated by sizebot against afe3496

@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Sep 2, 2026
@eps1lon
eps1lon requested a review from hoxyq September 2, 2026 14:37
@eps1lon
eps1lon marked this pull request as ready for review September 2, 2026 14:37
@eps1lon
eps1lon merged commit 0d69e20 into main Sep 2, 2026
248 checks passed
@eps1lon
eps1lon deleted the sebbie/conditional-use-canary branch September 2, 2026 15:47
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.

2 participants