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

Function deleteChild

code/styling/public/app.js:8913–8932  ·  view source on GitHub ↗
(returnFiber, childToDelete)

Source from the content-addressed store, hash-verified

8911// live outside of this function.
8912function ChildReconciler(shouldTrackSideEffects) {
8913 function deleteChild(returnFiber, childToDelete) {
8914 if (!shouldTrackSideEffects) {
8915 // Noop.
8916 return;
8917 }
8918 // Deletions are added in reversed order so we add it to the front.
8919 // At this point, the return fiber's effect list is empty except for
8920 // deletions, so we can just append the deletion to the list. The remaining
8921 // effects aren't added until the complete phase. Once we implement
8922 // resuming, this may not be true.
8923 var last = returnFiber.lastEffect;
8924 if (last !== null) {
8925 last.nextEffect = childToDelete;
8926 returnFiber.lastEffect = childToDelete;
8927 } else {
8928 returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
8929 }
8930 childToDelete.nextEffect = null;
8931 childToDelete.effectTag = Deletion;
8932 }
8933
8934 function deleteRemainingChildren(returnFiber, currentFirstChild) {
8935 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