Home / Function/ declareTemporary() — react Function Reference

declareTemporary() — react Function Reference

Architecture documentation for the declareTemporary() function in InlineImmediatelyInvokedFunctionExpressions.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d7bc118d_2cd4_19ba_9472_2ac2a9c28f4c["declareTemporary()"]
  e96debd1_c62e_fa86_d259_20617c0dc175["InlineImmediatelyInvokedFunctionExpressions.ts"]
  d7bc118d_2cd4_19ba_9472_2ac2a9c28f4c -->|defined in| e96debd1_c62e_fa86_d259_20617c0dc175
  d77babff_42d3_5fdf_4059_c0b9e7cfaeb0["inlineImmediatelyInvokedFunctionExpressions()"]
  d77babff_42d3_5fdf_4059_c0b9e7cfaeb0 -->|calls| d7bc118d_2cd4_19ba_9472_2ac2a9c28f4c
  53244187_914c_cc90_5880_7bfc1fc9c0bb["push()"]
  d7bc118d_2cd4_19ba_9472_2ac2a9c28f4c -->|calls| 53244187_914c_cc90_5880_7bfc1fc9c0bb
  49446ae1_b830_9411_8258_1139d21b314b["createTemporaryPlace()"]
  d7bc118d_2cd4_19ba_9472_2ac2a9c28f4c -->|calls| 49446ae1_b830_9411_8258_1139d21b314b
  style d7bc118d_2cd4_19ba_9472_2ac2a9c28f4c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Inference/InlineImmediatelyInvokedFunctionExpressions.ts lines 316–336

function declareTemporary(
  env: Environment,
  block: BasicBlock,
  result: Place,
): void {
  block.instructions.push({
    id: makeInstructionId(0),
    loc: GeneratedSource,
    lvalue: createTemporaryPlace(env, result.loc),
    value: {
      kind: 'DeclareLocal',
      lvalue: {
        place: result,
        kind: InstructionKind.Let,
      },
      type: null,
      loc: result.loc,
    },
    effects: null,
  });
}

Domain

Subdomains

Frequently Asked Questions

What does declareTemporary() do?
declareTemporary() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InlineImmediatelyInvokedFunctionExpressions.ts.
Where is declareTemporary() defined?
declareTemporary() is defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InlineImmediatelyInvokedFunctionExpressions.ts at line 316.
What does declareTemporary() call?
declareTemporary() calls 2 function(s): createTemporaryPlace, push.
What calls declareTemporary()?
declareTemporary() is called by 1 function(s): inlineImmediatelyInvokedFunctionExpressions.

Analyze Your Own Codebase

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

Try Supermodel Free