Home / Function/ markNode() — react Function Reference

markNode() — react Function Reference

Architecture documentation for the markNode() function in ExhaustiveDeps.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  de7f78c0_3370_f4c0_ba0d_ed04d502120f["markNode()"]
  ea02b01a_dd46_4b35_fe00_775aec496668["ExhaustiveDeps.ts"]
  de7f78c0_3370_f4c0_ba0d_ed04d502120f -->|defined in| ea02b01a_dd46_4b35_fe00_775aec496668
  bf9b6b10_9341_d44c_d960_2c1a990db056["analyzePropertyChain()"]
  bf9b6b10_9341_d44c_d960_2c1a990db056 -->|calls| de7f78c0_3370_f4c0_ba0d_ed04d502120f
  style de7f78c0_3370_f4c0_ba0d_ed04d502120f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts lines 1901–1918

function markNode(
  node: Node,
  optionalChains: Map<string, boolean> | null,
  result: string,
): void {
  if (optionalChains) {
    if ('optional' in node && node.optional) {
      // We only want to consider it optional if *all* usages were optional.
      if (!optionalChains.has(result)) {
        // Mark as (maybe) optional. If there's a required usage, this will be overridden.
        optionalChains.set(result, true);
      }
    } else {
      // Mark as required.
      optionalChains.set(result, false);
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does markNode() do?
markNode() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts.
Where is markNode() defined?
markNode() is defined in packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts at line 1901.
What calls markNode()?
markNode() is called by 1 function(s): analyzePropertyChain.

Analyze Your Own Codebase

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

Try Supermodel Free