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

Function deleteChild

code/new-context-api/public/app.js:8274–8293  ·  view source on GitHub ↗
(returnFiber, childToDelete)

Source from the content-addressed store, hash-verified

8272// live outside of this function.
8273function ChildReconciler(shouldTrackSideEffects) {
8274 function deleteChild(returnFiber, childToDelete) {
8275 if (!shouldTrackSideEffects) {
8276 // Noop.
8277 return;
8278 }
8279 // Deletions are added in reversed order so we add it to the front.
8280 // At this point, the return fiber's effect list is empty except for
8281 // deletions, so we can just append the deletion to the list. The remaining
8282 // effects aren't added until the complete phase. Once we implement
8283 // resuming, this may not be true.
8284 var last = returnFiber.lastEffect;
8285 if (last !== null) {
8286 last.nextEffect = childToDelete;
8287 returnFiber.lastEffect = childToDelete;
8288 } else {
8289 returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
8290 }
8291 childToDelete.nextEffect = null;
8292 childToDelete.effectTag = Deletion;
8293 }
8294
8295 function deleteRemainingChildren(returnFiber, currentFirstChild) {
8296 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