mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
Follow up to #28783 and #28786. Since we've changed the implementations of these we can rename them to something a bit more descriptive while we're at it, since anyone depending on them will need to upgrade their code anyway. "react" with no condition: `__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` "react" with "react-server" condition: `__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` "react-dom": `__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`
25 lines
704 B
JavaScript
25 lines
704 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 * as React from 'react';
|
|
|
|
const ReactSharedInternalsServer =
|
|
// $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;
|