Home / Function/ tryToClaimNextHydratableFormMarkerInstance() — react Function Reference

tryToClaimNextHydratableFormMarkerInstance() — react Function Reference

Architecture documentation for the tryToClaimNextHydratableFormMarkerInstance() function in ReactFiberHydrationContext.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  842b7c57_27ab_db40_014d_ba7c60dcfce1["tryToClaimNextHydratableFormMarkerInstance()"]
  4bc7109f_638d_d9f7_bf47_6ec55b2fa128["ReactFiberHydrationContext.js"]
  842b7c57_27ab_db40_014d_ba7c60dcfce1 -->|defined in| 4bc7109f_638d_d9f7_bf47_6ec55b2fa128
  80ab8739_b87f_ce9e_47e3_2b23b5998883["throwOnHydrationMismatch()"]
  842b7c57_27ab_db40_014d_ba7c60dcfce1 -->|calls| 80ab8739_b87f_ce9e_47e3_2b23b5998883
  style 842b7c57_27ab_db40_014d_ba7c60dcfce1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberHydrationContext.js lines 514–540

export function tryToClaimNextHydratableFormMarkerInstance(
  fiber: Fiber,
): boolean {
  if (!isHydrating) {
    return false;
  }
  if (nextHydratableInstance) {
    const markerInstance = canHydrateFormStateMarker(
      nextHydratableInstance,
      rootOrSingletonContext,
    );
    if (markerInstance) {
      // Found the marker instance.
      nextHydratableInstance = getNextHydratableSibling(markerInstance);
      // Return true if this marker instance should use the state passed
      // to hydrateRoot.
      // TODO: As an optimization, Fizz should only emit these markers if form
      // state is passed at the root.
      return isFormStateMarkerMatching(markerInstance);
    }
  }
  // Should have found a marker instance. Throw an error to trigger client
  // rendering. We don't bother to check if we're in a concurrent root because
  // useActionState is a new API, so backwards compat is not an issue.
  throwOnHydrationMismatch(fiber);
  return false;
}

Domain

Subdomains

Frequently Asked Questions

What does tryToClaimNextHydratableFormMarkerInstance() do?
tryToClaimNextHydratableFormMarkerInstance() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberHydrationContext.js.
Where is tryToClaimNextHydratableFormMarkerInstance() defined?
tryToClaimNextHydratableFormMarkerInstance() is defined in packages/react-reconciler/src/ReactFiberHydrationContext.js at line 514.
What does tryToClaimNextHydratableFormMarkerInstance() call?
tryToClaimNextHydratableFormMarkerInstance() calls 1 function(s): throwOnHydrationMismatch.

Analyze Your Own Codebase

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

Try Supermodel Free