popHydrationState() — react Function Reference
Architecture documentation for the popHydrationState() function in ReactFiberHydrationContext.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD b741356a_b031_e7cd_ea5d_ed59f056748d["popHydrationState()"] 4bc7109f_638d_d9f7_bf47_6ec55b2fa128["ReactFiberHydrationContext.js"] b741356a_b031_e7cd_ea5d_ed59f056748d -->|defined in| 4bc7109f_638d_d9f7_bf47_6ec55b2fa128 44c16661_4569_a3d1_aee6_5c634865dd4f["completeDehydratedActivityBoundary()"] 44c16661_4569_a3d1_aee6_5c634865dd4f -->|calls| b741356a_b031_e7cd_ea5d_ed59f056748d f7a91352_2453_8bcd_5056_584b2804cbf7["completeDehydratedSuspenseBoundary()"] f7a91352_2453_8bcd_5056_584b2804cbf7 -->|calls| b741356a_b031_e7cd_ea5d_ed59f056748d 0b8db832_87fd_e560_8aa8_e2b319c81626["completeWork()"] 0b8db832_87fd_e560_8aa8_e2b319c81626 -->|calls| b741356a_b031_e7cd_ea5d_ed59f056748d 6b27a70e_e4c9_73ee_c331_a59342af28a3["popToNextHostParent()"] b741356a_b031_e7cd_ea5d_ed59f056748d -->|calls| 6b27a70e_e4c9_73ee_c331_a59342af28a3 7c2189dd_f0c5_03ea_484b_2da399ad0e70["warnIfUnhydratedTailNodes()"] b741356a_b031_e7cd_ea5d_ed59f056748d -->|calls| 7c2189dd_f0c5_03ea_484b_2da399ad0e70 80ab8739_b87f_ce9e_47e3_2b23b5998883["throwOnHydrationMismatch()"] b741356a_b031_e7cd_ea5d_ed59f056748d -->|calls| 80ab8739_b87f_ce9e_47e3_2b23b5998883 8b71ce74_d8c0_0acb_ce64_4739cedd13ea["skipPastDehydratedSuspenseInstance()"] b741356a_b031_e7cd_ea5d_ed59f056748d -->|calls| 8b71ce74_d8c0_0acb_ce64_4739cedd13ea b4084a13_bce4_2287_2652_d91eb0dd6f26["skipPastDehydratedActivityInstance()"] b741356a_b031_e7cd_ea5d_ed59f056748d -->|calls| b4084a13_bce4_2287_2652_d91eb0dd6f26 style b741356a_b031_e7cd_ea5d_ed59f056748d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-reconciler/src/ReactFiberHydrationContext.js lines 734–806
function popHydrationState(fiber: Fiber): boolean {
if (!supportsHydration) {
return false;
}
if (fiber !== hydrationParentFiber) {
// We're deeper than the current hydration context, inside an inserted
// tree.
return false;
}
if (!isHydrating) {
// If we're not currently hydrating but we're in a hydration context, then
// we were an insertion and now need to pop up reenter hydration of our
// siblings.
popToNextHostParent(fiber);
isHydrating = true;
return false;
}
const tag = fiber.tag;
if (supportsSingletons) {
// With float we never clear the Root, or Singleton instances. We also do not clear Instances
// that have singleton text content
if (
tag !== HostRoot &&
tag !== HostSingleton &&
!(
tag === HostComponent &&
(!shouldDeleteUnhydratedTailInstances(fiber.type) ||
shouldSetTextContent(fiber.type, fiber.memoizedProps))
)
) {
const nextInstance = nextHydratableInstance;
if (nextInstance) {
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch(fiber);
}
}
} else {
// If we have any remaining hydratable nodes, we need to delete them now.
// We only do this deeper than head and body since they tend to have random
// other nodes in them. We also ignore components with pure text content in
// side of them. We also don't delete anything inside the root container.
if (
tag !== HostRoot &&
(tag !== HostComponent ||
(shouldDeleteUnhydratedTailInstances(fiber.type) &&
!shouldSetTextContent(fiber.type, fiber.memoizedProps)))
) {
const nextInstance = nextHydratableInstance;
if (nextInstance) {
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch(fiber);
}
}
}
popToNextHostParent(fiber);
if (tag === SuspenseComponent) {
nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
} else if (tag === ActivityComponent) {
nextHydratableInstance = skipPastDehydratedActivityInstance(fiber);
} else if (supportsSingletons && tag === HostSingleton) {
nextHydratableInstance = getNextHydratableSiblingAfterSingleton(
fiber.type,
nextHydratableInstance,
);
} else {
nextHydratableInstance = hydrationParentFiber
? getNextHydratableSibling(fiber.stateNode)
: null;
}
return true;
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does popHydrationState() do?
popHydrationState() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberHydrationContext.js.
Where is popHydrationState() defined?
popHydrationState() is defined in packages/react-reconciler/src/ReactFiberHydrationContext.js at line 734.
What does popHydrationState() call?
popHydrationState() calls 5 function(s): popToNextHostParent, skipPastDehydratedActivityInstance, skipPastDehydratedSuspenseInstance, throwOnHydrationMismatch, warnIfUnhydratedTailNodes.
What calls popHydrationState()?
popHydrationState() is called by 3 function(s): completeDehydratedActivityBoundary, completeDehydratedSuspenseBoundary, completeWork.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free