Skip to content

Support experimental.useExperimentalReact to opt into React's experimental channel #2109

Description

@github-actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    nextjs-trackingTracking issue for a Next.js canary change relevant to vinext

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions