Home / Function/ emitDestructureProps() — react Function Reference

emitDestructureProps() — react Function Reference

Architecture documentation for the emitDestructureProps() function in OutlineJsx.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  80dcbf5f_ebdd_7414_3c78_4a7de7b352b8["emitDestructureProps()"]
  158befb1_050c_87d2_b4ec_54305bac5a4f["OutlineJsx.ts"]
  80dcbf5f_ebdd_7414_3c78_4a7de7b352b8 -->|defined in| 158befb1_050c_87d2_b4ec_54305bac5a4f
  c201bbda_dc3c_7b58_7ce0_7d61d25ef972["emitOutlinedFn()"]
  c201bbda_dc3c_7b58_7ce0_7d61d25ef972 -->|calls| 80dcbf5f_ebdd_7414_3c78_4a7de7b352b8
  53244187_914c_cc90_5880_7bfc1fc9c0bb["push()"]
  80dcbf5f_ebdd_7414_3c78_4a7de7b352b8 -->|calls| 53244187_914c_cc90_5880_7bfc1fc9c0bb
  d0270ab6_a621_bd55_a1b9_a5cad8b406b2["makeInstructionId()"]
  80dcbf5f_ebdd_7414_3c78_4a7de7b352b8 -->|calls| d0270ab6_a621_bd55_a1b9_a5cad8b406b2
  49446ae1_b830_9411_8258_1139d21b314b["createTemporaryPlace()"]
  80dcbf5f_ebdd_7414_3c78_4a7de7b352b8 -->|calls| 49446ae1_b830_9411_8258_1139d21b314b
  style 80dcbf5f_ebdd_7414_3c78_4a7de7b352b8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Optimization/OutlineJsx.ts lines 490–528

function emitDestructureProps(
  env: Environment,
  propsObj: Place,
  oldToNewProps: Map<IdentifierId, OutlinedJsxAttribute>,
): Instruction {
  const properties: Array<ObjectProperty> = [];
  for (const [_, prop] of oldToNewProps) {
    properties.push({
      kind: 'ObjectProperty',
      key: {
        kind: 'string',
        name: prop.newName,
      },
      type: 'property',
      place: prop.place,
    });
  }

  const destructurePropsInstr: Instruction = {
    id: makeInstructionId(0),
    lvalue: createTemporaryPlace(env, GeneratedSource),
    loc: GeneratedSource,
    value: {
      kind: 'Destructure',
      lvalue: {
        pattern: {
          kind: 'ObjectPattern',
          properties,
          loc: GeneratedSource,
        },
        kind: InstructionKind.Let,
      },
      loc: GeneratedSource,
      value: propsObj,
    },
    effects: null,
  };
  return destructurePropsInstr;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does emitDestructureProps() do?
emitDestructureProps() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/OutlineJsx.ts.
Where is emitDestructureProps() defined?
emitDestructureProps() is defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/OutlineJsx.ts at line 490.
What does emitDestructureProps() call?
emitDestructureProps() calls 3 function(s): createTemporaryPlace, makeInstructionId, push.
What calls emitDestructureProps()?
emitDestructureProps() is called by 1 function(s): emitOutlinedFn.

Analyze Your Own Codebase

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

Try Supermodel Free