react-test-renderer 18.2.0 → 18.3.0-next-522f47345-20220614
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3570,7 +3570,13 @@ function enqueueConcurrentRenderForLane(fiber, lane) {
|
|
|
3570
3570
|
var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
|
|
3571
3571
|
|
|
3572
3572
|
function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
|
|
3573
|
-
//
|
|
3573
|
+
// TODO: We will detect and infinite update loop and throw even if this fiber
|
|
3574
|
+
// has already unmounted. This isn't really necessary but it happens to be the
|
|
3575
|
+
// current behavior we've used for several release cycles. Consider not
|
|
3576
|
+
// performing this check if the updated fiber already unmounted, since it's
|
|
3577
|
+
// not possible for that to cause an infinite update loop.
|
|
3578
|
+
throwIfInfiniteUpdateLoopDetected(); // Update the source fiber's lanes
|
|
3579
|
+
|
|
3574
3580
|
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
|
|
3575
3581
|
var alternate = sourceFiber.alternate;
|
|
3576
3582
|
|
|
@@ -4627,7 +4633,7 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
|
|
4627
4633
|
}
|
|
4628
4634
|
|
|
4629
4635
|
if (typeof instance.componentDidMount === 'function') {
|
|
4630
|
-
var fiberFlags = Update;
|
|
4636
|
+
var fiberFlags = Update | LayoutStatic;
|
|
4631
4637
|
|
|
4632
4638
|
workInProgress.flags |= fiberFlags;
|
|
4633
4639
|
}
|
|
@@ -4671,7 +4677,7 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
|
|
4671
4677
|
// If an update was already in progress, we should schedule an Update
|
|
4672
4678
|
// effect even though we're bailing out, so that cWU/cDU are called.
|
|
4673
4679
|
if (typeof instance.componentDidMount === 'function') {
|
|
4674
|
-
var fiberFlags = Update;
|
|
4680
|
+
var fiberFlags = Update | LayoutStatic;
|
|
4675
4681
|
|
|
4676
4682
|
workInProgress.flags |= fiberFlags;
|
|
4677
4683
|
}
|
|
@@ -4700,7 +4706,7 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
|
|
4700
4706
|
}
|
|
4701
4707
|
|
|
4702
4708
|
if (typeof instance.componentDidMount === 'function') {
|
|
4703
|
-
var _fiberFlags = Update;
|
|
4709
|
+
var _fiberFlags = Update | LayoutStatic;
|
|
4704
4710
|
|
|
4705
4711
|
workInProgress.flags |= _fiberFlags;
|
|
4706
4712
|
}
|
|
@@ -4708,7 +4714,7 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
|
|
4708
4714
|
// If an update was already in progress, we should schedule an Update
|
|
4709
4715
|
// effect even though we're bailing out, so that cWU/cDU are called.
|
|
4710
4716
|
if (typeof instance.componentDidMount === 'function') {
|
|
4711
|
-
var _fiberFlags2 = Update;
|
|
4717
|
+
var _fiberFlags2 = Update | LayoutStatic;
|
|
4712
4718
|
|
|
4713
4719
|
workInProgress.flags |= _fiberFlags2;
|
|
4714
4720
|
} // If shouldComponentUpdate returned false, we should still update the
|
|
@@ -7122,7 +7128,7 @@ function updateInsertionEffect(create, deps) {
|
|
|
7122
7128
|
}
|
|
7123
7129
|
|
|
7124
7130
|
function mountLayoutEffect(create, deps) {
|
|
7125
|
-
var fiberFlags = Update;
|
|
7131
|
+
var fiberFlags = Update | LayoutStatic;
|
|
7126
7132
|
|
|
7127
7133
|
return mountEffectImpl(fiberFlags, Layout, create, deps);
|
|
7128
7134
|
}
|
|
@@ -7168,7 +7174,7 @@ function mountImperativeHandle(ref, create, deps) {
|
|
|
7168
7174
|
|
|
7169
7175
|
|
|
7170
7176
|
var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
|
|
7171
|
-
var fiberFlags = Update;
|
|
7177
|
+
var fiberFlags = Update | LayoutStatic;
|
|
7172
7178
|
|
|
7173
7179
|
return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
|
|
7174
7180
|
}
|
|
@@ -9450,6 +9456,7 @@ function markRef(current, workInProgress) {
|
|
|
9450
9456
|
if (current === null && ref !== null || current !== null && current.ref !== ref) {
|
|
9451
9457
|
// Schedule a Ref effect
|
|
9452
9458
|
workInProgress.flags |= Ref;
|
|
9459
|
+
workInProgress.flags |= RefStatic;
|
|
9453
9460
|
}
|
|
9454
9461
|
}
|
|
9455
9462
|
|
|
@@ -11440,7 +11447,7 @@ function markUpdate(workInProgress) {
|
|
|
11440
11447
|
}
|
|
11441
11448
|
|
|
11442
11449
|
function markRef$1(workInProgress) {
|
|
11443
|
-
workInProgress.flags |= Ref;
|
|
11450
|
+
workInProgress.flags |= Ref | RefStatic;
|
|
11444
11451
|
}
|
|
11445
11452
|
|
|
11446
11453
|
var appendAllChildren;
|
|
@@ -12448,6 +12455,10 @@ function unwindWork(current, workInProgress, renderLanes) {
|
|
|
12448
12455
|
|
|
12449
12456
|
return null;
|
|
12450
12457
|
|
|
12458
|
+
case TracingMarkerComponent:
|
|
12459
|
+
|
|
12460
|
+
return null;
|
|
12461
|
+
|
|
12451
12462
|
default:
|
|
12452
12463
|
return null;
|
|
12453
12464
|
}
|
|
@@ -12724,6 +12735,11 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
|
|
|
12724
12735
|
{
|
|
12725
12736
|
didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
|
|
12726
12737
|
} // Used during the commit phase to track the state of the Offscreen component stack.
|
|
12738
|
+
// Allows us to avoid traversing the return path to find the nearest Offscreen ancestor.
|
|
12739
|
+
|
|
12740
|
+
|
|
12741
|
+
var offscreenSubtreeIsHidden = false;
|
|
12742
|
+
var offscreenSubtreeWasHidden = false;
|
|
12727
12743
|
var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
|
|
12728
12744
|
var nextEffect = null; // Used for Profiling builds to track updaters.
|
|
12729
12745
|
function reportUncaughtErrorInDEV(error) {
|
|
@@ -12757,6 +12773,15 @@ var callComponentWillUnmountWithTimer = function (current, instance) {
|
|
|
12757
12773
|
}; // Capture errors so they don't interrupt mounting.
|
|
12758
12774
|
|
|
12759
12775
|
|
|
12776
|
+
function safelyCallCommitHookLayoutEffectListMount(current, nearestMountedAncestor) {
|
|
12777
|
+
try {
|
|
12778
|
+
commitHookEffectListMount(Layout, current);
|
|
12779
|
+
} catch (error) {
|
|
12780
|
+
captureCommitPhaseError(current, nearestMountedAncestor, error);
|
|
12781
|
+
}
|
|
12782
|
+
} // Capture errors so they don't interrupt unmounting.
|
|
12783
|
+
|
|
12784
|
+
|
|
12760
12785
|
function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) {
|
|
12761
12786
|
try {
|
|
12762
12787
|
callComponentWillUnmountWithTimer(current, instance);
|
|
@@ -12765,6 +12790,24 @@ function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instanc
|
|
|
12765
12790
|
}
|
|
12766
12791
|
} // Capture errors so they don't interrupt mounting.
|
|
12767
12792
|
|
|
12793
|
+
|
|
12794
|
+
function safelyCallComponentDidMount(current, nearestMountedAncestor, instance) {
|
|
12795
|
+
try {
|
|
12796
|
+
instance.componentDidMount();
|
|
12797
|
+
} catch (error) {
|
|
12798
|
+
captureCommitPhaseError(current, nearestMountedAncestor, error);
|
|
12799
|
+
}
|
|
12800
|
+
} // Capture errors so they don't interrupt mounting.
|
|
12801
|
+
|
|
12802
|
+
|
|
12803
|
+
function safelyAttachRef(current, nearestMountedAncestor) {
|
|
12804
|
+
try {
|
|
12805
|
+
commitAttachRef(current);
|
|
12806
|
+
} catch (error) {
|
|
12807
|
+
captureCommitPhaseError(current, nearestMountedAncestor, error);
|
|
12808
|
+
}
|
|
12809
|
+
}
|
|
12810
|
+
|
|
12768
12811
|
function safelyDetachRef(current, nearestMountedAncestor) {
|
|
12769
12812
|
var ref = current.ref;
|
|
12770
12813
|
|
|
@@ -13098,7 +13141,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committe
|
|
|
13098
13141
|
case ForwardRef:
|
|
13099
13142
|
case SimpleMemoComponent:
|
|
13100
13143
|
{
|
|
13101
|
-
{
|
|
13144
|
+
if (!offscreenSubtreeWasHidden) {
|
|
13102
13145
|
// At this point layout effects have already been destroyed (during mutation phase).
|
|
13103
13146
|
// This is done to prevent sibling component effects from interfering with each other,
|
|
13104
13147
|
// e.g. a destroy function in one component should never override a ref set
|
|
@@ -13123,7 +13166,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committe
|
|
|
13123
13166
|
var instance = finishedWork.stateNode;
|
|
13124
13167
|
|
|
13125
13168
|
if (finishedWork.flags & Update) {
|
|
13126
|
-
{
|
|
13169
|
+
if (!offscreenSubtreeWasHidden) {
|
|
13127
13170
|
if (current === null) {
|
|
13128
13171
|
// We could update instance props and state here,
|
|
13129
13172
|
// but instead we rely on them being set during last render.
|
|
@@ -13336,7 +13379,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committe
|
|
|
13336
13379
|
}
|
|
13337
13380
|
}
|
|
13338
13381
|
|
|
13339
|
-
{
|
|
13382
|
+
if (!offscreenSubtreeWasHidden) {
|
|
13340
13383
|
{
|
|
13341
13384
|
if (finishedWork.flags & Ref) {
|
|
13342
13385
|
commitAttachRef(finishedWork);
|
|
@@ -13345,6 +13388,48 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committe
|
|
|
13345
13388
|
}
|
|
13346
13389
|
}
|
|
13347
13390
|
|
|
13391
|
+
function reappearLayoutEffectsOnFiber(node) {
|
|
13392
|
+
// Turn on layout effects in a tree that previously disappeared.
|
|
13393
|
+
// TODO (Offscreen) Check: flags & LayoutStatic
|
|
13394
|
+
switch (node.tag) {
|
|
13395
|
+
case FunctionComponent:
|
|
13396
|
+
case ForwardRef:
|
|
13397
|
+
case SimpleMemoComponent:
|
|
13398
|
+
{
|
|
13399
|
+
if ( node.mode & ProfileMode) {
|
|
13400
|
+
try {
|
|
13401
|
+
startLayoutEffectTimer();
|
|
13402
|
+
safelyCallCommitHookLayoutEffectListMount(node, node.return);
|
|
13403
|
+
} finally {
|
|
13404
|
+
recordLayoutEffectDuration(node);
|
|
13405
|
+
}
|
|
13406
|
+
} else {
|
|
13407
|
+
safelyCallCommitHookLayoutEffectListMount(node, node.return);
|
|
13408
|
+
}
|
|
13409
|
+
|
|
13410
|
+
break;
|
|
13411
|
+
}
|
|
13412
|
+
|
|
13413
|
+
case ClassComponent:
|
|
13414
|
+
{
|
|
13415
|
+
var instance = node.stateNode;
|
|
13416
|
+
|
|
13417
|
+
if (typeof instance.componentDidMount === 'function') {
|
|
13418
|
+
safelyCallComponentDidMount(node, node.return, instance);
|
|
13419
|
+
}
|
|
13420
|
+
|
|
13421
|
+
safelyAttachRef(node, node.return);
|
|
13422
|
+
break;
|
|
13423
|
+
}
|
|
13424
|
+
|
|
13425
|
+
case HostComponent:
|
|
13426
|
+
{
|
|
13427
|
+
safelyAttachRef(node, node.return);
|
|
13428
|
+
break;
|
|
13429
|
+
}
|
|
13430
|
+
}
|
|
13431
|
+
}
|
|
13432
|
+
|
|
13348
13433
|
function hideOrUnhideAllChildren(finishedWork, isHidden) {
|
|
13349
13434
|
// Only hide or unhide the top-most host nodes.
|
|
13350
13435
|
var hostSubtreeRoot = null;
|
|
@@ -13790,7 +13875,7 @@ function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, dele
|
|
|
13790
13875
|
switch (deletedFiber.tag) {
|
|
13791
13876
|
case HostComponent:
|
|
13792
13877
|
{
|
|
13793
|
-
{
|
|
13878
|
+
if (!offscreenSubtreeWasHidden) {
|
|
13794
13879
|
safelyDetachRef(deletedFiber, nearestMountedAncestor);
|
|
13795
13880
|
} // Intentional fallthrough to next branch
|
|
13796
13881
|
|
|
@@ -13863,7 +13948,7 @@ function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, dele
|
|
|
13863
13948
|
case MemoComponent:
|
|
13864
13949
|
case SimpleMemoComponent:
|
|
13865
13950
|
{
|
|
13866
|
-
{
|
|
13951
|
+
if (!offscreenSubtreeWasHidden) {
|
|
13867
13952
|
var updateQueue = deletedFiber.updateQueue;
|
|
13868
13953
|
|
|
13869
13954
|
if (updateQueue !== null) {
|
|
@@ -13905,7 +13990,7 @@ function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, dele
|
|
|
13905
13990
|
|
|
13906
13991
|
case ClassComponent:
|
|
13907
13992
|
{
|
|
13908
|
-
{
|
|
13993
|
+
if (!offscreenSubtreeWasHidden) {
|
|
13909
13994
|
safelyDetachRef(deletedFiber, nearestMountedAncestor);
|
|
13910
13995
|
var instance = deletedFiber.stateNode;
|
|
13911
13996
|
|
|
@@ -13927,7 +14012,21 @@ function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, dele
|
|
|
13927
14012
|
|
|
13928
14013
|
case OffscreenComponent:
|
|
13929
14014
|
{
|
|
13930
|
-
{
|
|
14015
|
+
if (deletedFiber.mode & ConcurrentMode) {
|
|
14016
|
+
// If this offscreen component is hidden, we already unmounted it. Before
|
|
14017
|
+
// deleting the children, track that it's already unmounted so that we
|
|
14018
|
+
// don't attempt to unmount the effects again.
|
|
14019
|
+
// TODO: If the tree is hidden, in most cases we should be able to skip
|
|
14020
|
+
// over the nested children entirely. An exception is we haven't yet found
|
|
14021
|
+
// the topmost host node to delete, which we already track on the stack.
|
|
14022
|
+
// But the other case is portals, which need to be detached no matter how
|
|
14023
|
+
// deeply they are nested. We should use a subtree flag to track whether a
|
|
14024
|
+
// subtree includes a nested portal.
|
|
14025
|
+
var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
|
|
14026
|
+
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;
|
|
14027
|
+
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
14028
|
+
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
14029
|
+
} else {
|
|
13931
14030
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
13932
14031
|
}
|
|
13933
14032
|
|
|
@@ -14217,7 +14316,15 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
|
|
14217
14316
|
{
|
|
14218
14317
|
var _wasHidden = current !== null && current.memoizedState !== null;
|
|
14219
14318
|
|
|
14220
|
-
{
|
|
14319
|
+
if (finishedWork.mode & ConcurrentMode) {
|
|
14320
|
+
// Before committing the children, track on the stack whether this
|
|
14321
|
+
// offscreen subtree was already hidden, so that we don't unmount the
|
|
14322
|
+
// effects again.
|
|
14323
|
+
var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
|
|
14324
|
+
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;
|
|
14325
|
+
recursivelyTraverseMutationEffects(root, finishedWork);
|
|
14326
|
+
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
14327
|
+
} else {
|
|
14221
14328
|
recursivelyTraverseMutationEffects(root, finishedWork);
|
|
14222
14329
|
}
|
|
14223
14330
|
|
|
@@ -14234,6 +14341,21 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
|
|
14234
14341
|
|
|
14235
14342
|
_offscreenInstance.isHidden = _isHidden;
|
|
14236
14343
|
|
|
14344
|
+
if (_isHidden) {
|
|
14345
|
+
if (!_wasHidden) {
|
|
14346
|
+
if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
|
|
14347
|
+
nextEffect = offscreenBoundary;
|
|
14348
|
+
var offscreenChild = offscreenBoundary.child;
|
|
14349
|
+
|
|
14350
|
+
while (offscreenChild !== null) {
|
|
14351
|
+
nextEffect = offscreenChild;
|
|
14352
|
+
disappearLayoutEffects_begin(offscreenChild);
|
|
14353
|
+
offscreenChild = offscreenChild.sibling;
|
|
14354
|
+
}
|
|
14355
|
+
}
|
|
14356
|
+
}
|
|
14357
|
+
}
|
|
14358
|
+
|
|
14237
14359
|
{
|
|
14238
14360
|
// TODO: This needs to run whenever there's an insertion or update
|
|
14239
14361
|
// inside a hidden Offscreen tree.
|
|
@@ -14309,6 +14431,51 @@ function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) {
|
|
|
14309
14431
|
var fiber = nextEffect;
|
|
14310
14432
|
var firstChild = fiber.child;
|
|
14311
14433
|
|
|
14434
|
+
if (fiber.tag === OffscreenComponent && isModernRoot) {
|
|
14435
|
+
// Keep track of the current Offscreen stack's state.
|
|
14436
|
+
var isHidden = fiber.memoizedState !== null;
|
|
14437
|
+
var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
|
|
14438
|
+
|
|
14439
|
+
if (newOffscreenSubtreeIsHidden) {
|
|
14440
|
+
// The Offscreen tree is hidden. Skip over its layout effects.
|
|
14441
|
+
commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes);
|
|
14442
|
+
continue;
|
|
14443
|
+
} else {
|
|
14444
|
+
// TODO (Offscreen) Also check: subtreeFlags & LayoutMask
|
|
14445
|
+
var current = fiber.alternate;
|
|
14446
|
+
var wasHidden = current !== null && current.memoizedState !== null;
|
|
14447
|
+
var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
|
|
14448
|
+
var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
|
|
14449
|
+
var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; // Traverse the Offscreen subtree with the current Offscreen as the root.
|
|
14450
|
+
|
|
14451
|
+
offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
|
|
14452
|
+
offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
|
|
14453
|
+
|
|
14454
|
+
if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
|
|
14455
|
+
// This is the root of a reappearing boundary. Turn its layout effects
|
|
14456
|
+
// back on.
|
|
14457
|
+
nextEffect = fiber;
|
|
14458
|
+
reappearLayoutEffects_begin(fiber);
|
|
14459
|
+
}
|
|
14460
|
+
|
|
14461
|
+
var child = firstChild;
|
|
14462
|
+
|
|
14463
|
+
while (child !== null) {
|
|
14464
|
+
nextEffect = child;
|
|
14465
|
+
commitLayoutEffects_begin(child, // New root; bubble back up to here and stop.
|
|
14466
|
+
root, committedLanes);
|
|
14467
|
+
child = child.sibling;
|
|
14468
|
+
} // Restore Offscreen state and resume in our-progress traversal.
|
|
14469
|
+
|
|
14470
|
+
|
|
14471
|
+
nextEffect = fiber;
|
|
14472
|
+
offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
|
|
14473
|
+
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
14474
|
+
commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes);
|
|
14475
|
+
continue;
|
|
14476
|
+
}
|
|
14477
|
+
}
|
|
14478
|
+
|
|
14312
14479
|
if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
|
|
14313
14480
|
firstChild.return = fiber;
|
|
14314
14481
|
nextEffect = firstChild;
|
|
@@ -14352,6 +14519,157 @@ function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) {
|
|
|
14352
14519
|
}
|
|
14353
14520
|
}
|
|
14354
14521
|
|
|
14522
|
+
function disappearLayoutEffects_begin(subtreeRoot) {
|
|
14523
|
+
while (nextEffect !== null) {
|
|
14524
|
+
var fiber = nextEffect;
|
|
14525
|
+
var firstChild = fiber.child; // TODO (Offscreen) Check: flags & (RefStatic | LayoutStatic)
|
|
14526
|
+
|
|
14527
|
+
switch (fiber.tag) {
|
|
14528
|
+
case FunctionComponent:
|
|
14529
|
+
case ForwardRef:
|
|
14530
|
+
case MemoComponent:
|
|
14531
|
+
case SimpleMemoComponent:
|
|
14532
|
+
{
|
|
14533
|
+
if ( fiber.mode & ProfileMode) {
|
|
14534
|
+
try {
|
|
14535
|
+
startLayoutEffectTimer();
|
|
14536
|
+
commitHookEffectListUnmount(Layout, fiber, fiber.return);
|
|
14537
|
+
} finally {
|
|
14538
|
+
recordLayoutEffectDuration(fiber);
|
|
14539
|
+
}
|
|
14540
|
+
} else {
|
|
14541
|
+
commitHookEffectListUnmount(Layout, fiber, fiber.return);
|
|
14542
|
+
}
|
|
14543
|
+
|
|
14544
|
+
break;
|
|
14545
|
+
}
|
|
14546
|
+
|
|
14547
|
+
case ClassComponent:
|
|
14548
|
+
{
|
|
14549
|
+
// TODO (Offscreen) Check: flags & RefStatic
|
|
14550
|
+
safelyDetachRef(fiber, fiber.return);
|
|
14551
|
+
var instance = fiber.stateNode;
|
|
14552
|
+
|
|
14553
|
+
if (typeof instance.componentWillUnmount === 'function') {
|
|
14554
|
+
safelyCallComponentWillUnmount(fiber, fiber.return, instance);
|
|
14555
|
+
}
|
|
14556
|
+
|
|
14557
|
+
break;
|
|
14558
|
+
}
|
|
14559
|
+
|
|
14560
|
+
case HostComponent:
|
|
14561
|
+
{
|
|
14562
|
+
safelyDetachRef(fiber, fiber.return);
|
|
14563
|
+
break;
|
|
14564
|
+
}
|
|
14565
|
+
|
|
14566
|
+
case OffscreenComponent:
|
|
14567
|
+
{
|
|
14568
|
+
// Check if this is a
|
|
14569
|
+
var isHidden = fiber.memoizedState !== null;
|
|
14570
|
+
|
|
14571
|
+
if (isHidden) {
|
|
14572
|
+
// Nested Offscreen tree is already hidden. Don't disappear
|
|
14573
|
+
// its effects.
|
|
14574
|
+
disappearLayoutEffects_complete(subtreeRoot);
|
|
14575
|
+
continue;
|
|
14576
|
+
}
|
|
14577
|
+
|
|
14578
|
+
break;
|
|
14579
|
+
}
|
|
14580
|
+
} // TODO (Offscreen) Check: subtreeFlags & LayoutStatic
|
|
14581
|
+
|
|
14582
|
+
|
|
14583
|
+
if (firstChild !== null) {
|
|
14584
|
+
firstChild.return = fiber;
|
|
14585
|
+
nextEffect = firstChild;
|
|
14586
|
+
} else {
|
|
14587
|
+
disappearLayoutEffects_complete(subtreeRoot);
|
|
14588
|
+
}
|
|
14589
|
+
}
|
|
14590
|
+
}
|
|
14591
|
+
|
|
14592
|
+
function disappearLayoutEffects_complete(subtreeRoot) {
|
|
14593
|
+
while (nextEffect !== null) {
|
|
14594
|
+
var fiber = nextEffect;
|
|
14595
|
+
|
|
14596
|
+
if (fiber === subtreeRoot) {
|
|
14597
|
+
nextEffect = null;
|
|
14598
|
+
return;
|
|
14599
|
+
}
|
|
14600
|
+
|
|
14601
|
+
var sibling = fiber.sibling;
|
|
14602
|
+
|
|
14603
|
+
if (sibling !== null) {
|
|
14604
|
+
sibling.return = fiber.return;
|
|
14605
|
+
nextEffect = sibling;
|
|
14606
|
+
return;
|
|
14607
|
+
}
|
|
14608
|
+
|
|
14609
|
+
nextEffect = fiber.return;
|
|
14610
|
+
}
|
|
14611
|
+
}
|
|
14612
|
+
|
|
14613
|
+
function reappearLayoutEffects_begin(subtreeRoot) {
|
|
14614
|
+
while (nextEffect !== null) {
|
|
14615
|
+
var fiber = nextEffect;
|
|
14616
|
+
var firstChild = fiber.child;
|
|
14617
|
+
|
|
14618
|
+
if (fiber.tag === OffscreenComponent) {
|
|
14619
|
+
var isHidden = fiber.memoizedState !== null;
|
|
14620
|
+
|
|
14621
|
+
if (isHidden) {
|
|
14622
|
+
// Nested Offscreen tree is still hidden. Don't re-appear its effects.
|
|
14623
|
+
reappearLayoutEffects_complete(subtreeRoot);
|
|
14624
|
+
continue;
|
|
14625
|
+
}
|
|
14626
|
+
} // TODO (Offscreen) Check: subtreeFlags & LayoutStatic
|
|
14627
|
+
|
|
14628
|
+
|
|
14629
|
+
if (firstChild !== null) {
|
|
14630
|
+
// This node may have been reused from a previous render, so we can't
|
|
14631
|
+
// assume its return pointer is correct.
|
|
14632
|
+
firstChild.return = fiber;
|
|
14633
|
+
nextEffect = firstChild;
|
|
14634
|
+
} else {
|
|
14635
|
+
reappearLayoutEffects_complete(subtreeRoot);
|
|
14636
|
+
}
|
|
14637
|
+
}
|
|
14638
|
+
}
|
|
14639
|
+
|
|
14640
|
+
function reappearLayoutEffects_complete(subtreeRoot) {
|
|
14641
|
+
while (nextEffect !== null) {
|
|
14642
|
+
var fiber = nextEffect; // TODO (Offscreen) Check: flags & LayoutStatic
|
|
14643
|
+
|
|
14644
|
+
setCurrentFiber(fiber);
|
|
14645
|
+
|
|
14646
|
+
try {
|
|
14647
|
+
reappearLayoutEffectsOnFiber(fiber);
|
|
14648
|
+
} catch (error) {
|
|
14649
|
+
captureCommitPhaseError(fiber, fiber.return, error);
|
|
14650
|
+
}
|
|
14651
|
+
|
|
14652
|
+
resetCurrentFiber();
|
|
14653
|
+
|
|
14654
|
+
if (fiber === subtreeRoot) {
|
|
14655
|
+
nextEffect = null;
|
|
14656
|
+
return;
|
|
14657
|
+
}
|
|
14658
|
+
|
|
14659
|
+
var sibling = fiber.sibling;
|
|
14660
|
+
|
|
14661
|
+
if (sibling !== null) {
|
|
14662
|
+
// This node may have been reused from a previous render, so we can't
|
|
14663
|
+
// assume its return pointer is correct.
|
|
14664
|
+
sibling.return = fiber.return;
|
|
14665
|
+
nextEffect = sibling;
|
|
14666
|
+
return;
|
|
14667
|
+
}
|
|
14668
|
+
|
|
14669
|
+
nextEffect = fiber.return;
|
|
14670
|
+
}
|
|
14671
|
+
}
|
|
14672
|
+
|
|
14355
14673
|
function commitPassiveMountEffects(root, finishedWork, committedLanes, committedTransitions) {
|
|
14356
14674
|
nextEffect = finishedWork;
|
|
14357
14675
|
commitPassiveMountEffects_begin(finishedWork, root, committedLanes, committedTransitions);
|
|
@@ -14848,8 +15166,6 @@ function requestRetryLane(fiber) {
|
|
|
14848
15166
|
}
|
|
14849
15167
|
|
|
14850
15168
|
function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
|
|
14851
|
-
checkForNestedUpdates();
|
|
14852
|
-
|
|
14853
15169
|
{
|
|
14854
15170
|
if (isRunningInsertionEffect) {
|
|
14855
15171
|
error('useInsertionEffect must not schedule updates.');
|
|
@@ -16486,7 +16802,7 @@ function jnd(timeElapsed) {
|
|
|
16486
16802
|
return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
|
|
16487
16803
|
}
|
|
16488
16804
|
|
|
16489
|
-
function
|
|
16805
|
+
function throwIfInfiniteUpdateLoopDetected() {
|
|
16490
16806
|
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
|
|
16491
16807
|
nestedUpdateCount = 0;
|
|
16492
16808
|
rootWithNestedUpdates = null;
|
|
@@ -17689,7 +18005,7 @@ identifierPrefix, onRecoverableError, transitionCallbacks) {
|
|
|
17689
18005
|
return root;
|
|
17690
18006
|
}
|
|
17691
18007
|
|
|
17692
|
-
var ReactVersion = '18.
|
|
18008
|
+
var ReactVersion = '18.3.0-next-522f47345-20220614';
|
|
17693
18009
|
|
|
17694
18010
|
var didWarnAboutNestedUpdates;
|
|
17695
18011
|
|