@@ -37,8 +37,6 @@ import type {
3737import type { UpdateQueue } from './ReactFiberClassUpdateQueue' ;
3838import type { RootState } from './ReactFiberRoot' ;
3939import type { TracingMarkerInstance } from './ReactFiberTracingMarkerComponent' ;
40- import type { TransitionStatus } from './ReactFiberConfig' ;
41- import type { Hook } from './ReactFiberHooks' ;
4240
4341import {
4442 markComponentRenderStarted ,
@@ -100,7 +98,6 @@ import {
10098 enableProfilerCommitHooks ,
10199 enableProfilerTimer ,
102100 enableScopeAPI ,
103- enableLazyContextPropagation ,
104101 enableSchedulingProfiler ,
105102 enableTransitionTracing ,
106103 enableLegacyHidden ,
@@ -272,7 +269,6 @@ import {
272269 createClassErrorUpdate ,
273270 initializeClassErrorUpdate ,
274271} from './ReactFiberThrow' ;
275- import is from 'shared/objectIs' ;
276272import {
277273 getForksAtLevel ,
278274 isForkedChild ,
@@ -843,7 +839,7 @@ function deferHiddenOffscreenComponent(
843839
844840 pushOffscreenSuspenseHandler ( workInProgress ) ;
845841
846- if ( enableLazyContextPropagation && current !== null ) {
842+ if ( current !== null ) {
847843 // Since this tree will resume rendering in a separate render, we need
848844 // to propagate parent contexts now so we don't lose track of which
849845 // ones changed.
@@ -1636,26 +1632,6 @@ function updateHostComponent(
16361632 } else {
16371633 HostTransitionContext . _currentValue2 = newState ;
16381634 }
1639- if (enableLazyContextPropagation) {
1640- // In the lazy propagation implementation, we don't scan for matching
1641- // consumers until something bails out.
1642- } else {
1643- if ( didReceiveUpdate ) {
1644- if ( current !== null ) {
1645- const oldStateHook : Hook = current . memoizedState ;
1646- const oldState : TransitionStatus = oldStateHook . memoizedState ;
1647- // This uses regular equality instead of Object.is because we assume
1648- // that host transition state doesn't include NaN as a valid type.
1649- if ( oldState !== newState ) {
1650- propagateContextChange (
1651- workInProgress ,
1652- HostTransitionContext ,
1653- renderLanes ,
1654- ) ;
1655- }
1656- }
1657- }
1658- }
16591635 }
16601636
16611637 markRef ( current , workInProgress ) ;
@@ -2706,10 +2682,7 @@ function updateDehydratedSuspenseComponent(
27062682 }
27072683
27082684 if (
2709- enableLazyContextPropagation &&
27102685 // TODO: Factoring is a little weird, since we check this right below, too.
2711- // But don't want to re-arrange the if-else chain until/unless this
2712- // feature lands.
27132686 ! didReceiveUpdate
27142687 ) {
27152688 // We need to check if any children have context before we decide to bail
@@ -3300,8 +3273,6 @@ function updateContextProvider(
33003273 context = workInProgress . type . _context ;
33013274 }
33023275 const newProps = workInProgress . pendingProps ;
3303- const oldProps = workInProgress . memoizedProps ;
3304-
33053276 const newValue = newProps . value ;
33063277
33073278 if ( __DEV__ ) {
@@ -3317,34 +3288,6 @@ function updateContextProvider(
33173288
33183289 pushProvider ( workInProgress , context , newValue ) ;
33193290
3320- if ( enableLazyContextPropagation ) {
3321- // In the lazy propagation implementation, we don't scan for matching
3322- // consumers until something bails out, because until something bails out
3323- // we're going to visit those nodes, anyway. The trade-off is that it shifts
3324- // responsibility to the consumer to track whether something has changed.
3325- } else {
3326- if ( oldProps !== null ) {
3327- const oldValue = oldProps . value ;
3328- if ( is ( oldValue , newValue ) ) {
3329- // No change. Bailout early if children are the same.
3330- if (
3331- oldProps . children === newProps . children &&
3332- ! hasLegacyContextChanged ( )
3333- ) {
3334- return bailoutOnAlreadyFinishedWork (
3335- current ,
3336- workInProgress ,
3337- renderLanes ,
3338- ) ;
3339- }
3340- } else {
3341- // The context value changed. Search for matching consumers and schedule
3342- // them to update.
3343- propagateContextChange ( workInProgress , context , renderLanes ) ;
3344- }
3345- }
3346- }
3347-
33483291 const newChildren = newProps . children ;
33493292 reconcileChildren ( current , workInProgress , newChildren , renderLanes ) ;
33503293 return workInProgress . child ;
@@ -3463,7 +3406,7 @@ function bailoutOnAlreadyFinishedWork(
34633406 // TODO: Once we add back resuming, we should check if the children are
34643407 // a work-in-progress set. If so, we need to transfer their effects.
34653408
3466- if ( enableLazyContextPropagation && current !== null ) {
3409+ if ( current !== null ) {
34673410 // Before bailing out, check if there are any context changes in
34683411 // the children.
34693412 lazilyPropagateParentContextChanges ( current , workInProgress , renderLanes ) ;
@@ -3564,11 +3507,9 @@ function checkScheduledUpdateOrContext(
35643507 }
35653508 // No pending update, but because context is propagated lazily, we need
35663509 // to check for a context change before we bail out.
3567- if ( enableLazyContextPropagation ) {
3568- const dependencies = current . dependencies ;
3569- if ( dependencies !== null && checkIfContextChanged ( dependencies ) ) {
3570- return true ;
3571- }
3510+ const dependencies = current . dependencies ;
3511+ if ( dependencies !== null && checkIfContextChanged ( dependencies ) ) {
3512+ return true ;
35723513 }
35733514 return false ;
35743515}
@@ -3706,7 +3647,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate(
37063647 workInProgress . childLanes ,
37073648 ) ;
37083649
3709- if ( enableLazyContextPropagation && ! hasChildWork ) {
3650+ if ( ! hasChildWork ) {
37103651 // Context changes may not have been propagated yet. We need to do
37113652 // that now, before we can decide whether to bail out.
37123653 // TODO: We use `childLanes` as a heuristic for whether there is
0 commit comments