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

Function deleteChild

code/communication/public/app.js:8948–8967  ·  view source on GitHub ↗
(returnFiber, childToDelete)

Source from the content-addressed store, hash-verified

8946// live outside of this function.
8947function ChildReconciler(shouldTrackSideEffects) {
8948 function deleteChild(returnFiber, childToDelete) {
8949 if (!shouldTrackSideEffects) {
8950 // Noop.
8951 return;
8952 }
8953 // Deletions are added in reversed order so we add it to the front.
8954 // At this point, the return fiber's effect list is empty except for
8955 // deletions, so we can just append the deletion to the list. The remaining
8956 // effects aren't added until the complete phase. Once we implement
8957 // resuming, this may not be true.
8958 var last = returnFiber.lastEffect;
8959 if (last !== null) {
8960 last.nextEffect = childToDelete;
8961 returnFiber.lastEffect = childToDelete;
8962 } else {
8963 returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
8964 }
8965 childToDelete.nextEffect = null;
8966 childToDelete.effectTag = Deletion;
8967 }
8968
8969 function deleteRemainingChildren(returnFiber, currentFirstChild) {
8970 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