Home / Function/ handleIdentifier() — react Function Reference

handleIdentifier() — react Function Reference

Architecture documentation for the handleIdentifier() function in FindContextIdentifiers.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  9c86ca57_13ec_3c6e_4642_8aa294c15ed8["handleIdentifier()"]
  4e92fe26_b973_d231_a810_396a7b9ddb12["FindContextIdentifiers.ts"]
  9c86ca57_13ec_3c6e_4642_8aa294c15ed8 -->|defined in| 4e92fe26_b973_d231_a810_396a7b9ddb12
  775f9df5_b68f_0833_1500_8b4a9a19addc["findContextIdentifiers()"]
  775f9df5_b68f_0833_1500_8b4a9a19addc -->|calls| 9c86ca57_13ec_3c6e_4642_8aa294c15ed8
  4fec6856_308b_3292_58ff_cf45694b83ec["getOrInsertDefault()"]
  9c86ca57_13ec_3c6e_4642_8aa294c15ed8 -->|calls| 4fec6856_308b_3292_58ff_cf45694b83ec
  style 9c86ca57_13ec_3c6e_4642_8aa294c15ed8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/FindContextIdentifiers.ts lines 115–136

function handleIdentifier(
  currentFn: BabelFunction | null,
  identifiers: Map<t.Identifier, IdentifierInfo>,
  path: NodePath<t.Identifier>,
): void {
  const name = path.node.name;
  const binding = path.scope.getBinding(name);
  if (binding == null) {
    return;
  }
  const identifier = getOrInsertDefault(identifiers, binding.identifier, {
    ...DEFAULT_IDENTIFIER_INFO,
  });

  if (currentFn != null) {
    const bindingAboveLambdaScope = currentFn.scope.parent.getBinding(name);

    if (binding === bindingAboveLambdaScope) {
      identifier.referencedByInnerFn = true;
    }
  }
}

Subdomains

Frequently Asked Questions

What does handleIdentifier() do?
handleIdentifier() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/FindContextIdentifiers.ts.
Where is handleIdentifier() defined?
handleIdentifier() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/FindContextIdentifiers.ts at line 115.
What does handleIdentifier() call?
handleIdentifier() calls 1 function(s): getOrInsertDefault.
What calls handleIdentifier()?
handleIdentifier() is called by 1 function(s): findContextIdentifiers.

Analyze Your Own Codebase

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

Try Supermodel Free