MCPcopy
hub / github.com/facebook/react / deleteChild

Function deleteChild

packages/react-reconciler/src/ReactChildFiber.js:430–442  ·  view source on GitHub ↗
(returnFiber: Fiber, childToDelete: Fiber)

Source from the content-addressed store, hash-verified

428 shouldTrackSideEffects: boolean,
429): ChildReconciler {
430 function deleteChild(returnFiber: Fiber, childToDelete: Fiber): void {
431 if (!shouldTrackSideEffects) {
432 // Noop.
433 return;
434 }
435 const deletions = returnFiber.deletions;
436 if (deletions === null) {
437 returnFiber.deletions = [childToDelete];
438 returnFiber.flags |= ChildDeletion;
439 } else {
440 deletions.push(childToDelete);
441 }
442 }
443
444 function deleteRemainingChildren(
445 returnFiber: Fiber,

Callers 5

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

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected