@@ -11,6 +11,8 @@ import type {HostConfig} from 'react-reconciler';
1111import type { ReactProviderType , ReactContext } from 'shared/ReactTypes' ;
1212import type { Fiber } from 'react-reconciler/src/ReactFiber' ;
1313import type { HostContext } from './ReactFiberHostContext' ;
14+ import type { LegacyContext } from './ReactFiberContext' ;
15+ import type { NewContext } from './ReactFiberNewContext' ;
1416import type { HydrationContext } from './ReactFiberHydrationContext' ;
1517import type { FiberRoot } from './ReactFiberRoot' ;
1618import type { ExpirationTime } from './ReactFiberExpirationTime' ;
@@ -56,15 +58,6 @@ import {
5658 cloneChildFibers ,
5759} from './ReactChildFiber' ;
5860import { processUpdateQueue } from './ReactFiberUpdateQueue' ;
59- import {
60- getMaskedContext ,
61- getUnmaskedContext ,
62- hasContextChanged as hasLegacyContextChanged ,
63- pushContextProvider as pushLegacyContextProvider ,
64- pushTopLevelContextObject ,
65- invalidateContextProvider ,
66- } from './ReactFiberContext' ;
67- import { pushProvider } from './ReactFiberNewContext' ;
6861import { NoWork , Never } from './ReactFiberExpirationTime' ;
6962import { AsyncMode , StrictMode } from './ReactTypeOfMode' ;
7063import MAX_SIGNED_31_BIT_INT from './maxSigned31BitInt' ;
@@ -82,6 +75,8 @@ if (__DEV__) {
8275export default function < T , P , I , TI , HI , PI , C , CC , CX , PL > (
8376 config : HostConfig < T , P , I , TI , HI , PI , C , CC , CX , PL > ,
8477 hostContext : HostContext < C , CX > ,
78+ legacyContext : LegacyContext ,
79+ newContext : NewContext ,
8580 hydrationContext : HydrationContext < C , CX > ,
8681 scheduleWork : ( fiber : Fiber , expirationTime : ExpirationTime ) = > void ,
8782 computeExpirationForFiber : ( fiber : Fiber ) = > ExpirationTime ,
@@ -90,6 +85,17 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
9085
9186 const { pushHostContext, pushHostContainer} = hostContext ;
9287
88+ const { pushProvider} = newContext ;
89+
90+ const {
91+ getMaskedContext,
92+ getUnmaskedContext,
93+ hasContextChanged : hasLegacyContextChanged ,
94+ pushContextProvider : pushLegacyContextProvider ,
95+ pushTopLevelContextObject,
96+ invalidateContextProvider,
97+ } = legacyContext ;
98+
9399 const {
94100 enterHydrationState,
95101 resetHydrationState,
@@ -104,6 +110,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
104110 resumeMountClassInstance,
105111 updateClassInstance,
106112 } = ReactFiberClassComponent (
113+ legacyContext ,
107114 scheduleWork ,
108115 computeExpirationForFiber ,
109116 memoizeProps ,
0 commit comments