MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / deleteChild

Function deleteChild

code/dependency-injection/public/app.js:9006–9025  ·  view source on GitHub ↗
(returnFiber, childToDelete)

Source from the content-addressed store, hash-verified

9004// live outside of this function.
9005function ChildReconciler(shouldTrackSideEffects) {
9006 function deleteChild(returnFiber, childToDelete) {
9007 if (!shouldTrackSideEffects) {
9008 // Noop.
9009 return;
9010 }
9011 // Deletions are added in reversed order so we add it to the front.
9012 // At this point, the return fiber's effect list is empty except for
9013 // deletions, so we can just append the deletion to the list. The remaining
9014 // effects aren't added until the complete phase. Once we implement
9015 // resuming, this may not be true.
9016 var last = returnFiber.lastEffect;
9017 if (last !== null) {
9018 last.nextEffect = childToDelete;
9019 returnFiber.lastEffect = childToDelete;
9020 } else {
9021 returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
9022 }
9023 childToDelete.nextEffect = null;
9024 childToDelete.effectTag = Deletion;
9025 }
9026
9027 function deleteRemainingChildren(returnFiber, currentFirstChild) {
9028 if (!shouldTrackSideEffects) {

Callers 5

deleteRemainingChildrenFunction · 0.70
reconcileChildrenArrayFunction · 0.70
reconcileSingleElementFunction · 0.70
reconcileSinglePortalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected