prepareToHydrateHostInstance() — react Function Reference
Architecture documentation for the prepareToHydrateHostInstance() function in ReactFiberHydrationContext.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD c3f56ddd_6159_7b0a_ff22_5226e70a7f05["prepareToHydrateHostInstance()"] 4bc7109f_638d_d9f7_bf47_6ec55b2fa128["ReactFiberHydrationContext.js"] c3f56ddd_6159_7b0a_ff22_5226e70a7f05 -->|defined in| 4bc7109f_638d_d9f7_bf47_6ec55b2fa128 0b8db832_87fd_e560_8aa8_e2b319c81626["completeWork()"] 0b8db832_87fd_e560_8aa8_e2b319c81626 -->|calls| c3f56ddd_6159_7b0a_ff22_5226e70a7f05 80ab8739_b87f_ce9e_47e3_2b23b5998883["throwOnHydrationMismatch()"] c3f56ddd_6159_7b0a_ff22_5226e70a7f05 -->|calls| 80ab8739_b87f_ce9e_47e3_2b23b5998883 style c3f56ddd_6159_7b0a_ff22_5226e70a7f05 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-reconciler/src/ReactFiberHydrationContext.js lines 542–564
function prepareToHydrateHostInstance(
fiber: Fiber,
hostContext: HostContext,
): void {
if (!supportsHydration) {
throw new Error(
'Expected prepareToHydrateHostInstance() to never be called. ' +
'This error is likely caused by a bug in React. Please file an issue.',
);
}
const instance: Instance = fiber.stateNode;
const didHydrate = hydrateInstance(
instance,
fiber.type,
fiber.memoizedProps,
hostContext,
fiber,
);
if (!didHydrate) {
throwOnHydrationMismatch(fiber, true);
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does prepareToHydrateHostInstance() do?
prepareToHydrateHostInstance() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberHydrationContext.js.
Where is prepareToHydrateHostInstance() defined?
prepareToHydrateHostInstance() is defined in packages/react-reconciler/src/ReactFiberHydrationContext.js at line 542.
What does prepareToHydrateHostInstance() call?
prepareToHydrateHostInstance() calls 1 function(s): throwOnHydrationMismatch.
What calls prepareToHydrateHostInstance()?
prepareToHydrateHostInstance() is called by 1 function(s): completeWork.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free