MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / deleteChild

Function deleteChild

bundle.js:7073–7082  ·  view source on GitHub ↗
(returnFiber,childToDelete)

Source from the content-addressed store, hash-verified

7071// a compiler or we can do it manually. Helpers that don't need this branching
7072// live outside of this function.
7073function ChildReconciler(shouldClone,shouldTrackSideEffects){function deleteChild(returnFiber,childToDelete){if(!shouldTrackSideEffects){// Noop.
7074return;}if(!shouldClone){// When we're reconciling in place we have a work in progress copy. We
7075// actually want the current copy. If there is no current copy, then we
7076// don't need to track deletion side-effects.
7077if(childToDelete.alternate===null){return;}childToDelete=childToDelete.alternate;}// Deletions are added in reversed order so we add it to the front.
7078// At this point, the return fiber's effect list is empty except for
7079// deletions, so we can just append the deletion to the list. The remaining
7080// effects aren't added until the complete phase. Once we implement
7081// resuming, this may not be true.
7082var last=returnFiber.lastEffect;if(last!==null){last.nextEffect=childToDelete;returnFiber.lastEffect=childToDelete;}else{returnFiber.firstEffect=returnFiber.lastEffect=childToDelete;}childToDelete.nextEffect=null;childToDelete.effectTag=Deletion$1;}function deleteRemainingChildren(returnFiber,currentFirstChild){if(!shouldTrackSideEffects){// Noop.
7083return null;}// TODO: For the shouldClone case, this could be micro-optimized a bit by
7084// assuming that after the first child we've already added everything.
7085var childToDelete=currentFirstChild;while(childToDelete!==null){deleteChild(returnFiber,childToDelete);childToDelete=childToDelete.sibling;}return null;}function mapRemainingChildren(returnFiber,currentFirstChild){// Add the remaining children to a temporary map so that we can find them by

Callers 6

deleteRemainingChildrenFunction · 0.85
reconcileChildrenArrayFunction · 0.85
reconcileSingleElementFunction · 0.85
reconcileSingleCoroutineFunction · 0.85
reconcileSinglePortalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected