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

Function deleteRemainingChildren

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

Source from the content-addressed store, hash-verified

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
7086// keys quickly. Implicit (null) keys get added to this set with their index
7087var existingChildren=new Map();var existingChild=currentFirstChild;while(existingChild!==null){if(existingChild.key!==null){existingChildren.set(existingChild.key,existingChild);}else{existingChildren.set(existingChild.index,existingChild);}existingChild=existingChild.sibling;}return existingChildren;}function useFiber(fiber,priority){// We currently set sibling to null and index to 0 here because it is easy
7088// to forget to do before returning it. E.g. for the single child case.

Callers 8

reconcileChildrenArrayFunction · 0.85
reconcileSingleTextNodeFunction · 0.85
reconcileSingleElementFunction · 0.85
reconcileSingleCoroutineFunction · 0.85
reconcileSingleYieldFunction · 0.85
reconcileSinglePortalFunction · 0.85
reconcileChildFibersFunction · 0.85

Calls 1

deleteChildFunction · 0.85

Tested by

no test coverage detected