dillon1000/react

Commit

Restrict React DOM imports from Server Components (#27382)

Adds a separate entry point for the react-dom package when it's accessed
from a Server Component environment, using the "react-server" export
condition.

When you're inside a Server Component module, you won't be able to
import client-only APIs like useState. This applies to almost all React
DOM exports, except for Float ones like preload.
Browse files
Changed paths6 files
First-parent comparison
A packages/react-dom/npm/react-dom.shared-subset.js AddedM packages/react-dom/package.json ModifiedA packages/react-dom/src/ReactDOMSharedSubset.js AddedM scripts/rollup/bundles.js ModifiedM scripts/rollup/forks.js ModifiedM scripts/shared/inlinedHostConfigs.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…