Files
react/packages/react-dom/src/ReactDOMSharedSubset.js
T
Andrew Clark 2d2f2af29b 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.
2023-09-15 14:53:19 -04:00

20 lines
517 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
// This is the subset of APIs that can be accessed from Server Component modules
export {default as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED} from './ReactDOMSharedInternals';
export {
prefetchDNS,
preconnect,
preload,
preloadModule,
preinit,
preinitModule,
} from './shared/ReactDOMFloat';