MCPcopy Index your code
hub / github.com/react/react / deleteRemainingChildren

Function deleteRemainingChildren

packages/react-reconciler/src/ReactChildFiber.js:444–461  ·  view source on GitHub ↗
(
    returnFiber: Fiber,
    currentFirstChild: Fiber | null,
  )

Source from the content-addressed store, hash-verified

442 }
443
444 function deleteRemainingChildren(
445 returnFiber: Fiber,
446 currentFirstChild: Fiber | null,
447 ): null {
448 if (!shouldTrackSideEffects) {
449 // Noop.
450 return null;
451 }
452
453 // TODO: For the shouldClone case, this could be micro-optimized a bit by
454 // assuming that after the first child we've already added everything.
455 let childToDelete = currentFirstChild;
456 while (childToDelete !== null) {
457 deleteChild(returnFiber, childToDelete);
458 childToDelete = childToDelete.sibling;
459 }
460 return null;
461 }
462
463 function mapRemainingChildren(
464 currentFirstChild: Fiber,

Callers 6

reconcileChildrenArrayFunction · 0.85
reconcileSingleTextNodeFunction · 0.85
reconcileSingleElementFunction · 0.85
reconcileSinglePortalFunction · 0.85
reconcileChildFibersImplFunction · 0.85

Calls 1

deleteChildFunction · 0.85

Tested by

no test coverage detected