mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
c7ba8c0988
I do this by simply renaming the secret export name in the "subset" bundle and this renamed version is what the FlightServer uses. This requires us to be more diligent about always using the correct instance of "react" in our tests so there's a bunch of clean up for that.
25 lines
698 B
JavaScript
25 lines
698 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 ReactSharedServerInternals =
|
|
// $FlowFixMe: It's defined in the one we resolve to.
|
|
React.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
|
|
if (!ReactSharedServerInternals) {
|
|
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 ReactSharedServerInternals;
|