Home / Function/ isHydratingParent() — react Function Reference

isHydratingParent() — react Function Reference

Architecture documentation for the isHydratingParent() function in ReactFiberCommitWork.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  89e7e23c_c509_bf3d_bde1_4381b90564b5["isHydratingParent()"]
  e0fbfbd5_47b0_a489_0b36_bbfad9245544["ReactFiberCommitWork.js"]
  89e7e23c_c509_bf3d_bde1_4381b90564b5 -->|defined in| e0fbfbd5_47b0_a489_0b36_bbfad9245544
  ce61aa22_42d2_811a_b317_96c8d0cb0321["commitLayoutEffectOnFiber()"]
  ce61aa22_42d2_811a_b317_96c8d0cb0321 -->|calls| 89e7e23c_c509_bf3d_bde1_4381b90564b5
  style 89e7e23c_c509_bf3d_bde1_4381b90564b5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberCommitWork.js lines 321–342

function isHydratingParent(current: Fiber, finishedWork: Fiber): boolean {
  if (finishedWork.tag === ActivityComponent) {
    const prevState: ActivityState | null = current.memoizedState;
    const nextState: ActivityState | null = finishedWork.memoizedState;
    return prevState !== null && nextState === null;
  } else if (finishedWork.tag === SuspenseComponent) {
    const prevState: SuspenseState | null = current.memoizedState;
    const nextState: SuspenseState | null = finishedWork.memoizedState;
    return (
      prevState !== null &&
      prevState.dehydrated !== null &&
      (nextState === null || nextState.dehydrated === null)
    );
  } else if (finishedWork.tag === HostRoot) {
    return (
      (current.memoizedState: RootState).isDehydrated &&
      (finishedWork.flags & ForceClientRender) === NoFlags
    );
  } else {
    return false;
  }
}

Domain

Subdomains

Frequently Asked Questions

What does isHydratingParent() do?
isHydratingParent() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCommitWork.js.
Where is isHydratingParent() defined?
isHydratingParent() is defined in packages/react-reconciler/src/ReactFiberCommitWork.js at line 321.
What calls isHydratingParent()?
isHydratingParent() is called by 1 function(s): commitLayoutEffectOnFiber.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free