MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / deleteChild

Function deleteChild

code/one-direction-data-flow/public/app.js:8786–8805  ·  view source on GitHub ↗
(returnFiber, childToDelete)

Source from the content-addressed store, hash-verified

8784// live outside of this function.
8785function ChildReconciler(shouldTrackSideEffects) {
8786 function deleteChild(returnFiber, childToDelete) {
8787 if (!shouldTrackSideEffects) {
8788 // Noop.
8789 return;
8790 }
8791 // Deletions are added in reversed order so we add it to the front.
8792 // At this point, the return fiber's effect list is empty except for
8793 // deletions, so we can just append the deletion to the list. The remaining
8794 // effects aren't added until the complete phase. Once we implement
8795 // resuming, this may not be true.
8796 var last = returnFiber.lastEffect;
8797 if (last !== null) {
8798 last.nextEffect = childToDelete;
8799 returnFiber.lastEffect = childToDelete;
8800 } else {
8801 returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
8802 }
8803 childToDelete.nextEffect = null;
8804 childToDelete.effectTag = Deletion;
8805 }
8806
8807 function deleteRemainingChildren(returnFiber, currentFirstChild) {
8808 if (!shouldTrackSideEffects) {

Callers 5

deleteRemainingChildrenFunction · 0.70
reconcileChildrenArrayFunction · 0.70
reconcileSingleElementFunction · 0.70
reconcileSinglePortalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected