Summary
Next.js added a new experimental.useExperimentalReact config option that opts the app into React's experimental release channel without requiring a side-effect feature like experimental.taint to be enabled. The experimental React build emits <link rel="expect"> to hold first paint until the streamed shell is coherent, avoiding flicker from partially-streamed HTML.
Previously, opting into the experimental channel required enabling an unrelated feature (taint, transitionIndicator, or gestureTransition) as a side effect. The new flag is a direct opt-in.
Behavior
experimental.useExperimentalReact: true selects the react@experimental build (alongside the existing taint/transitionIndicator/gestureTransition triggers)
- It is opt-in only: an explicit
false cannot disable the experimental channel when another feature still requires it (the taint APIs only exist in the experimental build); assignDefaults warns on that contradiction
- Feeds the existing
needsExperimentalReact aggregation in packages/next/src/lib/needs-experimental-react.ts
vinext implications
- Add the option to vinext's config schema/types so user configs don't error
- Decide whether to wire it up to a React channel switch (vinext currently doesn't ship the experimental React build by default); at minimum, accept the flag without crashing and document the support level
- If we do support it: validate the same contradiction-warning behavior when set to
false alongside taint/transitionIndicator/gestureTransition
Upstream
Summary
Next.js added a new
experimental.useExperimentalReactconfig option that opts the app into React's experimental release channel without requiring a side-effect feature likeexperimental.taintto be enabled. The experimental React build emits<link rel="expect">to hold first paint until the streamed shell is coherent, avoiding flicker from partially-streamed HTML.Previously, opting into the experimental channel required enabling an unrelated feature (
taint,transitionIndicator, orgestureTransition) as a side effect. The new flag is a direct opt-in.Behavior
experimental.useExperimentalReact: trueselects thereact@experimentalbuild (alongside the existingtaint/transitionIndicator/gestureTransitiontriggers)falsecannot disable the experimental channel when another feature still requires it (the taint APIs only exist in the experimental build);assignDefaultswarns on that contradictionneedsExperimentalReactaggregation inpackages/next/src/lib/needs-experimental-react.tsvinext implications
falsealongsidetaint/transitionIndicator/gestureTransitionUpstream
test/e2e/app-dir/rsc-basic/rsc-basic-use-experimental-react.test.ts