MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / popHydrationState

Function popHydrationState

code/composition/public/app.js:12352–12385  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

12350 }
12351
12352 function popHydrationState(fiber) {
12353 if (fiber !== hydrationParentFiber) {
12354 // We're deeper than the current hydration context, inside an inserted
12355 // tree.
12356 return false;
12357 }
12358 if (!isHydrating) {
12359 // If we're not currently hydrating but we're in a hydration context, then
12360 // we were an insertion and now need to pop up reenter hydration of our
12361 // siblings.
12362 popToNextHostParent(fiber);
12363 isHydrating = true;
12364 return false;
12365 }
12366
12367 var type = fiber.type;
12368
12369 // If we have any remaining hydratable nodes, we need to delete them now.
12370 // We only do this deeper than head and body since they tend to have random
12371 // other nodes in them. We also ignore components with pure text content in
12372 // side of them.
12373 // TODO: Better heuristic.
12374 if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
12375 var nextInstance = nextHydratableInstance;
12376 while (nextInstance) {
12377 deleteHydratableInstance(fiber, nextInstance);
12378 nextInstance = getNextHydratableSibling(nextInstance);
12379 }
12380 }
12381
12382 popToNextHostParent(fiber);
12383 nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
12384 return true;
12385 }
12386
12387 function resetHydrationState() {
12388 hydrationParentFiber = null;

Callers 1

completeWorkFunction · 0.70

Calls 2

popToNextHostParentFunction · 0.70
deleteHydratableInstanceFunction · 0.70

Tested by

no test coverage detected