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

Function deleteChild

code/higher-order-components/public/app.js:8907–8926  ·  view source on GitHub ↗
(returnFiber, childToDelete)

Source from the content-addressed store, hash-verified

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