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

Function placeChild

bundle.js:7092–7096  ·  view source on GitHub ↗
(newFiber,lastPlacedIndex,newIndex)

Source from the content-addressed store, hash-verified

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.
7096newFiber.effectTag=Placement$3;return lastPlacedIndex;}}function placeSingleChild(newFiber){// This is simpler for the single child case. We only need to do a
7097// placement for inserting new children.
7098if(shouldTrackSideEffects&&newFiber.alternate===null){newFiber.effectTag=Placement$3;}return newFiber;}function updateTextNode(returnFiber,current,textContent,priority){if(current===null||current.tag!==HostText$5){// Insert
7099var created=createFiberFromText$1(textContent,returnFiber.internalContextTag,priority);created['return']=returnFiber;return created;}else{// Update

Callers 2

reconcileChildrenArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected