Skip to content

Commit 066b206

Browse files
committed
derp... missing import
1 parent a7051aa commit 066b206

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

packages/react-client/src/ReactServerContext.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import {enableServerContext} from 'shared/ReactFeatureFlags';
2424
const globalServerContextRegistry =
2525
ReactSharedInternals.globalServerContextRegistry;
2626

27-
const DEFAULT_PLACEHOLDER = globalServerContextRegistry.__defaultValue;
27+
let DEFAULT_PLACEHOLDER;
28+
if (enableServerContext) {
29+
DEFAULT_PLACEHOLDER = globalServerContextRegistry.__defaultValue;
30+
}
2831

2932
export function createServerContext<T: ServerContextJSONValue>(
3033
globalName: string,

packages/react-server/src/ReactServerContext.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import {enableServerContext} from 'shared/ReactFeatureFlags';
2424
const globalServerContextRegistry =
2525
ReactSharedInternals.globalServerContextRegistry;
2626

27-
const DEFAULT_PLACEHOLDER = globalServerContextRegistry.__defaultValue;
27+
let DEFAULT_PLACEHOLDER;
28+
if (enableServerContext) {
29+
DEFAULT_PLACEHOLDER = globalServerContextRegistry.__defaultValue;
30+
}
2831

2932
export function createServerContext<T: ServerContextJSONValue>(
3033
globalName: string,

packages/react/src/ReactServerContext.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import {enableServerContext} from 'shared/ReactFeatureFlags';
2424
const globalServerContextRegistry =
2525
ReactSharedInternals.globalServerContextRegistry;
2626

27-
const DEFAULT_PLACEHOLDER = globalServerContextRegistry.__defaultValue;
27+
let DEFAULT_PLACEHOLDER;
28+
if (enableServerContext) {
29+
DEFAULT_PLACEHOLDER = globalServerContextRegistry.__defaultValue;
30+
}
2831

2932
export function createServerContext<T: ServerContextJSONValue>(
3033
globalName: string,

packages/react/src/forks/ReactSharedInternals.umd.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import ReactCurrentActQueue from '../ReactCurrentActQueue';
1212
import ReactCurrentOwner from '../ReactCurrentOwner';
1313
import ReactDebugCurrentFrame from '../ReactDebugCurrentFrame';
1414
import ReactCurrentBatchConfig from '../ReactCurrentBatchConfig';
15+
import {enableServerContext} from 'shared/ReactFeatureFlags';
16+
import {globalServerContextRegistry} from '../ReactServerContextRegistry';
1517

1618
const ReactSharedInternals = {
1719
ReactCurrentDispatcher,
@@ -33,4 +35,8 @@ if (__DEV__) {
3335
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
3436
}
3537

38+
if (enableServerContext) {
39+
ReactSharedInternals.globalServerContextRegistry = globalServerContextRegistry;
40+
}
41+
3642
export default ReactSharedInternals;

0 commit comments

Comments
 (0)