Files
react/packages/shared
Sebastian "Sebbie" Silbermann 0d69e20fc0 [flags] Enable conditional use() warning in React's Canary builds (#37491)
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."](https://react.dev/reference/react/use#conditional-use).

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.
2026-09-02 17:47:16 +02:00
..
2025-08-21 11:15:34 -04:00
2017-10-25 02:55:00 +03:00