| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | import type {SharedStateServer} from 'react/src/ReactSharedInternalsServer'; |
| 11 | |
| 12 | import * as React from 'react'; |
| 13 | |
| 14 | const ReactSharedInternalsServer: SharedStateServer = |
| 15 | // $FlowFixMe[incompatible-type]: It's defined in the one we resolve to. |
| 16 | // $FlowFixMe[missing-export] |
| 17 | React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; |
| 18 | |
| 19 | if (!ReactSharedInternalsServer) { |
| 20 | throw new Error( |
| 21 | 'The "react" package in this environment is not configured correctly. ' + |
| 22 | 'The "react-server" condition must be enabled in any environment that ' + |
| 23 | 'runs React Server Components.', |
| 24 | ); |
| 25 | } |
| 26 | |
| 27 | export default ReactSharedInternalsServer; |