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

Function deleteChild

code/controlled-uncontrolled/public/app.js:8237–8256  ·  view source on GitHub ↗
(returnFiber, childToDelete)

Source from the content-addressed store, hash-verified

8235// live outside of this function.
8236function ChildReconciler(shouldTrackSideEffects) {
8237 function deleteChild(returnFiber, childToDelete) {
8238 if (!shouldTrackSideEffects) {
8239 // Noop.
8240 return;
8241 }
8242 // Deletions are added in reversed order so we add it to the front.
8243 // At this point, the return fiber's effect list is empty except for
8244 // deletions, so we can just append the deletion to the list. The remaining
8245 // effects aren't added until the complete phase. Once we implement
8246 // resuming, this may not be true.
8247 var last = returnFiber.lastEffect;
8248 if (last !== null) {
8249 last.nextEffect = childToDelete;
8250 returnFiber.lastEffect = childToDelete;
8251 } else {
8252 returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
8253 }
8254 childToDelete.nextEffect = null;
8255 childToDelete.effectTag = Deletion;
8256 }
8257
8258 function deleteRemainingChildren(returnFiber, currentFirstChild) {
8259 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