Home / Function/ visitPrunedScope() — react Function Reference

visitPrunedScope() — react Function Reference

Architecture documentation for the visitPrunedScope() function in PromoteUsedTemporaries.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  03173b3f_4d79_dd9d_127a_8a267910b0f4["visitPrunedScope()"]
  6f12ca85_3acd_66b9_2d6f_c30299633549["CollectPromotableTemporaries"]
  03173b3f_4d79_dd9d_127a_8a267910b0f4 -->|defined in| 6f12ca85_3acd_66b9_2d6f_c30299633549
  f99db478_1015_8147_15db_df1530e07c0f["visitBlock()"]
  03173b3f_4d79_dd9d_127a_8a267910b0f4 -->|calls| f99db478_1015_8147_15db_df1530e07c0f
  7407a654_96a6_3be0_caee_2d3a63abc527["visitPrunedScope()"]
  03173b3f_4d79_dd9d_127a_8a267910b0f4 -->|calls| 7407a654_96a6_3be0_caee_2d3a63abc527
  style 03173b3f_4d79_dd9d_127a_8a267910b0f4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts lines 212–223

  override visitPrunedScope(
    scopeBlock: PrunedReactiveScopeBlock,
    state: State,
  ): void {
    for (const [_id, decl] of scopeBlock.scope.declarations) {
      state.pruned.set(decl.identifier.declarationId, {
        activeScopes: [...this.activeScopes],
        usedOutsideScope: false,
      });
    }
    this.visitBlock(scopeBlock.instructions, state);
  }

Frequently Asked Questions

What does visitPrunedScope() do?
visitPrunedScope() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts.
Where is visitPrunedScope() defined?
visitPrunedScope() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts at line 212.
What does visitPrunedScope() call?
visitPrunedScope() calls 2 function(s): visitBlock, visitPrunedScope.

Analyze Your Own Codebase

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

Try Supermodel Free