Home / Function/ buildFunctionExpression() — react Function Reference

buildFunctionExpression() — react Function Reference

Architecture documentation for the buildFunctionExpression() function in Gating.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  24718483_4b77_f6d6_eca3_ca709b5684ec["buildFunctionExpression()"]
  3acb56d9_57da_7e65_c06b_21b238146737["Gating.ts"]
  24718483_4b77_f6d6_eca3_ca709b5684ec -->|defined in| 3acb56d9_57da_7e65_c06b_21b238146737
  77b776cd_a7c8_1d29_ba32_e5a39fa85dd9["insertGatedFunctionDeclaration()"]
  77b776cd_a7c8_1d29_ba32_e5a39fa85dd9 -->|calls| 24718483_4b77_f6d6_eca3_ca709b5684ec
  style 24718483_4b77_f6d6_eca3_ca709b5684ec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Gating.ts lines 197–220

function buildFunctionExpression(
  node:
    | t.FunctionDeclaration
    | t.ArrowFunctionExpression
    | t.FunctionExpression,
): t.ArrowFunctionExpression | t.FunctionExpression {
  if (
    node.type === 'ArrowFunctionExpression' ||
    node.type === 'FunctionExpression'
  ) {
    return node;
  } else {
    const fn: t.FunctionExpression = {
      type: 'FunctionExpression',
      async: node.async,
      generator: node.generator,
      loc: node.loc ?? null,
      id: node.id ?? null,
      params: node.params,
      body: node.body,
    };
    return fn;
  }
}

Domain

Subdomains

Frequently Asked Questions

What does buildFunctionExpression() do?
buildFunctionExpression() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Gating.ts.
Where is buildFunctionExpression() defined?
buildFunctionExpression() is defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Gating.ts at line 197.
What calls buildFunctionExpression()?
buildFunctionExpression() is called by 1 function(s): insertGatedFunctionDeclaration.

Analyze Your Own Codebase

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

Try Supermodel Free