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

Function deleteHydratableInstance

code/third-party/public/app.js:11258–11286  ·  view source on GitHub ↗
(returnFiber, instance)

Source from the content-addressed store, hash-verified

11256 }
11257
11258 function deleteHydratableInstance(returnFiber, instance) {
11259 {
11260 switch (returnFiber.tag) {
11261 case HostRoot:
11262 didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
11263 break;
11264 case HostComponent:
11265 didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
11266 break;
11267 }
11268 }
11269
11270 var childToDelete = createFiberFromHostInstanceForDeletion();
11271 childToDelete.stateNode = instance;
11272 childToDelete['return'] = returnFiber;
11273 childToDelete.effectTag = Deletion;
11274
11275 // This might seem like it belongs on progressedFirstDeletion. However,
11276 // these children are not part of the reconciliation list of children.
11277 // Even if we abort and rereconcile the children, that will try to hydrate
11278 // again and the nodes are still in the host tree so these will be
11279 // recreated.
11280 if (returnFiber.lastEffect !== null) {
11281 returnFiber.lastEffect.nextEffect = childToDelete;
11282 returnFiber.lastEffect = childToDelete;
11283 } else {
11284 returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
11285 }
11286 }
11287
11288 function insertNonHydratedInstance(returnFiber, fiber) {
11289 fiber.effectTag |= Placement;

Callers 2

popHydrationStateFunction · 0.70

Tested by

no test coverage detected