File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ import {enableServerContext} from 'shared/ReactFeatureFlags';
2424const 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
2932export function createServerContext < T : ServerContextJSONValue > (
3033 globalName : string ,
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ import {enableServerContext} from 'shared/ReactFeatureFlags';
2424const 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
2932export function createServerContext < T : ServerContextJSONValue > (
3033 globalName : string ,
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ import {enableServerContext} from 'shared/ReactFeatureFlags';
2424const 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
2932export function createServerContext < T : ServerContextJSONValue > (
3033 globalName : string ,
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import ReactCurrentActQueue from '../ReactCurrentActQueue';
1212import ReactCurrentOwner from '../ReactCurrentOwner' ;
1313import ReactDebugCurrentFrame from '../ReactDebugCurrentFrame' ;
1414import ReactCurrentBatchConfig from '../ReactCurrentBatchConfig' ;
15+ import { enableServerContext } from 'shared/ReactFeatureFlags' ;
16+ import { globalServerContextRegistry } from '../ReactServerContextRegistry' ;
1517
1618const ReactSharedInternals = {
1719 ReactCurrentDispatcher,
@@ -33,4 +35,8 @@ if (__DEV__) {
3335 ReactSharedInternals . ReactDebugCurrentFrame = ReactDebugCurrentFrame ;
3436}
3537
38+ if ( enableServerContext ) {
39+ ReactSharedInternals . globalServerContextRegistry = globalServerContextRegistry ;
40+ }
41+
3642export default ReactSharedInternals ;
You can’t perform that action at this time.
0 commit comments