diff --git a/packages/react-server/src/ReactFlightServer.js b/packages/react-server/src/ReactFlightServer.js index c4b26520b6016..e8d120b952f1e 100644 --- a/packages/react-server/src/ReactFlightServer.js +++ b/packages/react-server/src/ReactFlightServer.js @@ -108,6 +108,7 @@ import { } from 'shared/ReactSerializationErrors'; import {getOrCreateServerContext} from 'shared/ReactServerContextRegistry'; +import ReactSharedInternals from 'shared/ReactSharedInternals'; import ReactServerSharedInternals from './ReactServerSharedInternals'; import isArray from 'shared/isArray'; import binaryToComparableString from 'shared/binaryToComparableString'; @@ -209,9 +210,9 @@ const { TaintRegistryValues, TaintRegistryByteLengths, TaintRegistryPendingRequests, - ReactCurrentDispatcher, ReactCurrentCache, } = ReactServerSharedInternals; +const ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; function throwTaintViolation(message: string) { // eslint-disable-next-line react-internal/prod-error-codes diff --git a/packages/react/src/ReactServerSharedInternals.js b/packages/react/src/ReactServerSharedInternals.js index 7b0cef8cb0a01..28ccb732ca7b3 100644 --- a/packages/react/src/ReactServerSharedInternals.js +++ b/packages/react/src/ReactServerSharedInternals.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import ReactCurrentDispatcher from './ReactCurrentDispatcher'; import ReactCurrentCache from './ReactCurrentCache'; import { TaintRegistryObjects, @@ -17,7 +16,6 @@ import { import {enableTaint} from 'shared/ReactFeatureFlags'; const ReactServerSharedInternals = { - ReactCurrentDispatcher, ReactCurrentCache, }; diff --git a/packages/react/src/ReactSharedInternalsServer.js b/packages/react/src/ReactSharedInternalsServer.js index 5e4aa64c3fd1a..7902104681dc1 100644 --- a/packages/react/src/ReactSharedInternalsServer.js +++ b/packages/react/src/ReactSharedInternalsServer.js @@ -5,12 +5,14 @@ * LICENSE file in the root directory of this source tree. */ +import ReactCurrentDispatcher from './ReactCurrentDispatcher'; import ReactCurrentOwner from './ReactCurrentOwner'; import ReactDebugCurrentFrame from './ReactDebugCurrentFrame'; import {enableServerContext} from 'shared/ReactFeatureFlags'; import {ContextRegistry} from './ReactServerContextRegistry'; const ReactSharedInternals = { + ReactCurrentDispatcher, ReactCurrentOwner, };