mirror of
https://github.com/facebook/react.git
synced 2026-02-24 12:43:00 +00:00
Need to tighten up this a bit. react-dom isomorphic currently depends on react-reconciler which is mostly DCE but it's pulled in which makes it hard to make other bundling changes. ReactFlightServer can have a hard dependency on the module that imports its internals since even if other internals are aliased it still always needs the server one.
27 lines
801 B
JavaScript
27 lines
801 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
|
|
*/
|
|
|
|
import type {SharedStateServer} from 'react/src/ReactSharedInternalsServer';
|
|
|
|
import * as React from 'react';
|
|
|
|
const ReactSharedInternalsServer: SharedStateServer =
|
|
// $FlowFixMe: It's defined in the one we resolve to.
|
|
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
|
|
if (!ReactSharedInternalsServer) {
|
|
throw new Error(
|
|
'The "react" package in this environment is not configured correctly. ' +
|
|
'The "react-server" condition must be enabled in any environment that ' +
|
|
'runs React Server Components.',
|
|
);
|
|
}
|
|
|
|
export default ReactSharedInternalsServer;
|