MCPcopy Create free account
hub / github.com/plotly/dash / commitPassiveUnmountEffects_begin

Function commitPassiveUnmountEffects_begin

dash/deps/react-dom@18.3.1.js:24993–25048  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24991 }
24992
24993 function commitPassiveUnmountEffects_begin() {
24994 while (nextEffect !== null) {
24995 var fiber = nextEffect;
24996 var child = fiber.child;
24997
24998 if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
24999 var deletions = fiber.deletions;
25000
25001 if (deletions !== null) {
25002 for (var i = 0; i < deletions.length; i++) {
25003 var fiberToDelete = deletions[i];
25004 nextEffect = fiberToDelete;
25005 commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
25006 }
25007
25008 {
25009 // A fiber was deleted from this parent fiber, but it's still part of
25010 // the previous (alternate) parent fiber's list of children. Because
25011 // children are a linked list, an earlier sibling that's still alive
25012 // will be connected to the deleted fiber via its `alternate`:
25013 //
25014 // live fiber
25015 // --alternate--> previous live fiber
25016 // --sibling--> deleted fiber
25017 //
25018 // We can't disconnect `alternate` on nodes that haven't been deleted
25019 // yet, but we can disconnect the `sibling` and `child` pointers.
25020 var previousFiber = fiber.alternate;
25021
25022 if (previousFiber !== null) {
25023 var detachedChild = previousFiber.child;
25024
25025 if (detachedChild !== null) {
25026 previousFiber.child = null;
25027
25028 do {
25029 var detachedSibling = detachedChild.sibling;
25030 detachedChild.sibling = null;
25031 detachedChild = detachedSibling;
25032 } while (detachedChild !== null);
25033 }
25034 }
25035 }
25036
25037 nextEffect = fiber;
25038 }
25039 }
25040
25041 if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
25042 child.return = fiber;
25043 nextEffect = child;
25044 } else {
25045 commitPassiveUnmountEffects_complete();
25046 }
25047 }
25048 }
25049
25050 function commitPassiveUnmountEffects_complete() {

Callers 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…