@@ -23,10 +23,7 @@ import {
2323} from 'shared/ReactSymbols' ;
2424import { ClassComponent , HostText , HostPortal , Fragment } from './ReactWorkTags' ;
2525import isArray from 'shared/isArray' ;
26- import {
27- warnAboutStringRefs ,
28- enableLazyElements ,
29- } from 'shared/ReactFeatureFlags' ;
26+ import { warnAboutStringRefs } from 'shared/ReactFeatureFlags' ;
3027import { checkPropStringCoercion } from 'shared/CheckStringCoercion' ;
3128
3229import {
@@ -414,8 +411,7 @@ function ChildReconciler(shouldTrackSideEffects) {
414411 // We need to do this after the Hot Reloading check above,
415412 // because hot reloading has different semantics than prod because
416413 // it doesn't resuspend. So we can't let the call below suspend.
417- ( enableLazyElements &&
418- typeof elementType === 'object' &&
414+ ( typeof elementType === 'object' &&
419415 elementType !== null &&
420416 elementType . $$typeof === REACT_LAZY_TYPE &&
421417 resolveLazy ( elementType ) === current . type )
@@ -530,11 +526,9 @@ function ChildReconciler(shouldTrackSideEffects) {
530526 return created ;
531527 }
532528 case REACT_LAZY_TYPE : {
533- if ( enableLazyElements ) {
534- const payload = newChild . _payload ;
535- const init = newChild . _init ;
536- return createChild ( returnFiber , init ( payload ) , lanes ) ;
537- }
529+ const payload = newChild . _payload ;
530+ const init = newChild . _init ;
531+ return createChild ( returnFiber , init ( payload ) , lanes ) ;
538532 }
539533 }
540534
@@ -601,11 +595,9 @@ function ChildReconciler(shouldTrackSideEffects) {
601595 }
602596 }
603597 case REACT_LAZY_TYPE : {
604- if ( enableLazyElements ) {
605- const payload = newChild . _payload ;
606- const init = newChild . _init ;
607- return updateSlot ( returnFiber , oldFiber , init ( payload ) , lanes ) ;
608- }
598+ const payload = newChild . _payload ;
599+ const init = newChild . _init ;
600+ return updateSlot ( returnFiber , oldFiber , init ( payload ) , lanes ) ;
609601 }
610602 }
611603
@@ -663,17 +655,15 @@ function ChildReconciler(shouldTrackSideEffects) {
663655 return updatePortal ( returnFiber , matchedFiber , newChild , lanes ) ;
664656 }
665657 case REACT_LAZY_TYPE :
666- if ( enableLazyElements ) {
667- const payload = newChild . _payload ;
668- const init = newChild . _init ;
669- return updateFromMap (
670- existingChildren ,
671- returnFiber ,
672- newIdx ,
673- init ( payload ) ,
674- lanes ,
675- ) ;
676- }
658+ const payload = newChild . _payload ;
659+ const init = newChild . _init ;
660+ return updateFromMap (
661+ existingChildren ,
662+ returnFiber ,
663+ newIdx ,
664+ init ( payload ) ,
665+ lanes ,
666+ ) ;
677667 }
678668
679669 if ( isArray ( newChild ) || getIteratorFn ( newChild ) ) {
@@ -732,14 +722,10 @@ function ChildReconciler(shouldTrackSideEffects) {
732722 ) ;
733723 break ;
734724 case REACT_LAZY_TYPE :
735- if ( enableLazyElements ) {
736- const payload = child . _payload ;
737- const init = ( child . _init : any ) ;
738- warnOnInvalidKey ( init ( payload ) , knownKeys , returnFiber ) ;
739- break ;
740- }
741- // We intentionally fallthrough here if enableLazyElements is not on.
742- // eslint-disable-next-lined no-fallthrough
725+ const payload = child . _payload ;
726+ const init = ( child . _init : any ) ;
727+ warnOnInvalidKey ( init ( payload ) , knownKeys , returnFiber ) ;
728+ break ;
743729 default:
744730 break ;
745731 }
@@ -1175,8 +1161,7 @@ function ChildReconciler(shouldTrackSideEffects) {
11751161 // We need to do this after the Hot Reloading check above,
11761162 // because hot reloading has different semantics than prod because
11771163 // it doesn't resuspend. So we can't let the call below suspend.
1178- ( enableLazyElements &&
1179- typeof elementType === 'object' &&
1164+ ( typeof elementType === 'object' &&
11801165 elementType !== null &&
11811166 elementType . $$typeof === REACT_LAZY_TYPE &&
11821167 resolveLazy ( elementType ) === child . type )
@@ -1302,17 +1287,15 @@ function ChildReconciler(shouldTrackSideEffects) {
13021287 ) ,
13031288 ) ;
13041289 case REACT_LAZY_TYPE :
1305- if ( enableLazyElements ) {
1306- const payload = newChild . _payload ;
1307- const init = newChild . _init ;
1308- // TODO: This function is supposed to be non-recursive.
1309- return reconcileChildFibers (
1310- returnFiber ,
1311- currentFirstChild ,
1312- init ( payload ) ,
1313- lanes ,
1314- ) ;
1315- }
1290+ const payload = newChild . _payload ;
1291+ const init = newChild . _init ;
1292+ // TODO: This function is supposed to be non-recursive.
1293+ return reconcileChildFibers (
1294+ returnFiber ,
1295+ currentFirstChild ,
1296+ init ( payload ) ,
1297+ lanes ,
1298+ ) ;
13161299 }
13171300
13181301 if ( isArray ( newChild ) ) {
0 commit comments