Home / Function/ capture() — react Function Reference

capture() — react Function Reference

Architecture documentation for the capture() function in InferMutationAliasingRanges.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  74920f87_fc03_df5c_ac10_8ca6db32d279["capture()"]
  78bdc9d3_b80e_c93f_98e8_83b50c1b2b77["AliasingState"]
  74920f87_fc03_df5c_ac10_8ca6db32d279 -->|defined in| 78bdc9d3_b80e_c93f_98e8_83b50c1b2b77
  f3815d1a_36a1_3e3d_92f2_dbbe88f01fe3["inferMutationAliasingRanges()"]
  f3815d1a_36a1_3e3d_92f2_dbbe88f01fe3 -->|calls| 74920f87_fc03_df5c_ac10_8ca6db32d279
  style 74920f87_fc03_df5c_ac10_8ca6db32d279 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingRanges.ts lines 627–637

  capture(index: number, from: Place, into: Place): void {
    const fromNode = this.nodes.get(from.identifier);
    const toNode = this.nodes.get(into.identifier);
    if (fromNode == null || toNode == null) {
      return;
    }
    fromNode.edges.push({index, node: into.identifier, kind: 'capture'});
    if (!toNode.captures.has(from.identifier)) {
      toNode.captures.set(from.identifier, index);
    }
  }

Domain

Subdomains

Frequently Asked Questions

What does capture() do?
capture() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingRanges.ts.
Where is capture() defined?
capture() is defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingRanges.ts at line 627.
What calls capture()?
capture() is called by 1 function(s): inferMutationAliasingRanges.

Analyze Your Own Codebase

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

Try Supermodel Free