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

Function useFiber

bundle.js:7087–7092  ·  view source on GitHub ↗
(fiber,priority)

Source from the content-addressed store, hash-verified

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.
7089if(shouldClone){var clone=createWorkInProgress$2(fiber,priority);clone.index=0;clone.sibling=null;return clone;}else{// We override the pending priority even if it is higher, because if
7090// we're reconciling at a lower priority that means that this was
7091// down-prioritized.
7092fiber.pendingWorkPriority=priority;fiber.effectTag=NoEffect$2;fiber.index=0;fiber.sibling=null;return fiber;}}function placeChild(newFiber,lastPlacedIndex,newIndex){newFiber.index=newIndex;if(!shouldTrackSideEffects){// Noop.
7093return lastPlacedIndex;}var current=newFiber.alternate;if(current!==null){var oldIndex=current.index;if(oldIndex<lastPlacedIndex){// This is a move.
7094newFiber.effectTag=Placement$3;return lastPlacedIndex;}else{// This item can stay in place.
7095return oldIndex;}}else{// This is an insertion.

Callers 11

updateTextNodeFunction · 0.85
updateElementFunction · 0.85
updateCoroutineFunction · 0.85
updateYieldFunction · 0.85
updatePortalFunction · 0.85
updateFragmentFunction · 0.85
reconcileSingleTextNodeFunction · 0.85
reconcileSingleElementFunction · 0.85
reconcileSingleCoroutineFunction · 0.85
reconcileSingleYieldFunction · 0.85
reconcileSinglePortalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected