MCPcopy Create free account
hub / github.com/microsoft/SandDance / detachFiber

Function detachFiber

docs/external/js/react-dom.development.js:20326–20348  ·  view source on GitHub ↗
(current)

Source from the content-addressed store, hash-verified

20324 }
20325
20326 function detachFiber(current) {
20327 var alternate = current.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we
20328 // should clear the child pointer of the parent alternate to let this
20329 // get GC:ed but we don't know which for sure which parent is the current
20330 // one so we'll settle for GC:ing the subtree of this child. This child
20331 // itself will be GC:ed when the parent updates the next time.
20332
20333 current.return = null;
20334 current.child = null;
20335 current.memoizedState = null;
20336 current.updateQueue = null;
20337 current.dependencies = null;
20338 current.alternate = null;
20339 current.firstEffect = null;
20340 current.lastEffect = null;
20341 current.pendingProps = null;
20342 current.memoizedProps = null;
20343 current.stateNode = null;
20344
20345 if (alternate !== null) {
20346 detachFiber(alternate);
20347 }
20348 }
20349
20350 function getHostParentFiber(fiber) {
20351 var parent = fiber.return;

Callers 1

commitDeletionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected