@@ -1324,58 +1324,56 @@ function commitDeletionEffectsOnFiber(
1324
1324
case ForwardRef :
1325
1325
case MemoComponent :
1326
1326
case SimpleMemoComponent : {
1327
- if ( ! offscreenSubtreeWasHidden ) {
1328
- const updateQueue : FunctionComponentUpdateQueue | null =
1329
- ( deletedFiber . updateQueue : any ) ;
1330
- if ( updateQueue !== null ) {
1331
- const lastEffect = updateQueue . lastEffect ;
1332
- if ( lastEffect !== null ) {
1333
- const firstEffect = lastEffect . next ;
1334
-
1335
- let effect = firstEffect ;
1336
- do {
1337
- const tag = effect . tag ;
1338
- const inst = effect . inst ;
1339
- const destroy = inst . destroy ;
1340
- if ( destroy !== undefined ) {
1341
- if ( ( tag & HookInsertion ) !== NoHookEffect ) {
1327
+ const updateQueue : FunctionComponentUpdateQueue | null =
1328
+ ( deletedFiber . updateQueue : any ) ;
1329
+ if ( updateQueue !== null ) {
1330
+ const lastEffect = updateQueue . lastEffect ;
1331
+ if ( lastEffect !== null ) {
1332
+ const firstEffect = lastEffect . next ;
1333
+
1334
+ let effect = firstEffect ;
1335
+ do {
1336
+ const tag = effect . tag ;
1337
+ const inst = effect . inst ;
1338
+ const destroy = inst . destroy ;
1339
+ if ( destroy !== undefined ) {
1340
+ if ( ( tag & HookInsertion ) !== NoHookEffect ) {
1341
+ inst . destroy = undefined ;
1342
+ safelyCallDestroy (
1343
+ deletedFiber ,
1344
+ nearestMountedAncestor ,
1345
+ destroy ,
1346
+ ) ;
1347
+ } else if ( ( tag & HookLayout ) !== NoHookEffect ) {
1348
+ if ( enableSchedulingProfiler ) {
1349
+ markComponentLayoutEffectUnmountStarted ( deletedFiber ) ;
1350
+ }
1351
+
1352
+ if ( shouldProfile ( deletedFiber ) ) {
1353
+ startLayoutEffectTimer ( ) ;
1342
1354
inst . destroy = undefined ;
1343
1355
safelyCallDestroy (
1344
1356
deletedFiber ,
1345
1357
nearestMountedAncestor ,
1346
1358
destroy ,
1347
1359
) ;
1348
- } else if ( ( tag & HookLayout ) !== NoHookEffect ) {
1349
- if ( enableSchedulingProfiler ) {
1350
- markComponentLayoutEffectUnmountStarted ( deletedFiber ) ;
1351
- }
1352
-
1353
- if ( shouldProfile ( deletedFiber ) ) {
1354
- startLayoutEffectTimer ( ) ;
1355
- inst . destroy = undefined ;
1356
- safelyCallDestroy (
1357
- deletedFiber ,
1358
- nearestMountedAncestor ,
1359
- destroy ,
1360
- ) ;
1361
- recordLayoutEffectDuration ( deletedFiber ) ;
1362
- } else {
1363
- inst . destroy = undefined ;
1364
- safelyCallDestroy (
1365
- deletedFiber ,
1366
- nearestMountedAncestor ,
1367
- destroy ,
1368
- ) ;
1369
- }
1360
+ recordLayoutEffectDuration ( deletedFiber ) ;
1361
+ } else {
1362
+ inst . destroy = undefined ;
1363
+ safelyCallDestroy (
1364
+ deletedFiber ,
1365
+ nearestMountedAncestor ,
1366
+ destroy ,
1367
+ ) ;
1368
+ }
1370
1369
1371
- if ( enableSchedulingProfiler ) {
1372
- markComponentLayoutEffectUnmountStopped ( ) ;
1373
- }
1370
+ if ( enableSchedulingProfiler ) {
1371
+ markComponentLayoutEffectUnmountStopped ( ) ;
1374
1372
}
1375
1373
}
1376
- effect = effect . next ;
1377
- } while ( effect !== firstEffect ) ;
1378
- }
1374
+ }
1375
+ effect = effect . next ;
1376
+ } while ( effect !== firstEffect ) ;
1379
1377
}
1380
1378
}
1381
1379
0 commit comments