Home / Function/ visitBreak() — react Function Reference

visitBreak() — react Function Reference

Architecture documentation for the visitBreak() function in BuildReactiveFunction.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  f1ad8882_f4aa_8bed_3eb6_757cd4990fab["visitBreak()"]
  e20dc57f_069b_7065_293d_92b4bae116ae["Driver"]
  f1ad8882_f4aa_8bed_3eb6_757cd4990fab -->|defined in| e20dc57f_069b_7065_293d_92b4bae116ae
  59c4bc0e_ec5f_af0c_d67c_d518b3f117bc["visitBlock()"]
  59c4bc0e_ec5f_af0c_d67c_d518b3f117bc -->|calls| f1ad8882_f4aa_8bed_3eb6_757cd4990fab
  c9d5ef77_d0cd_11c8_8414_09d6d6ce703e["getBreakTarget()"]
  f1ad8882_f4aa_8bed_3eb6_757cd4990fab -->|calls| c9d5ef77_d0cd_11c8_8414_09d6d6ce703e
  041ca752_10c1_3cda_1f5c_02f44a01310e["invariant()"]
  f1ad8882_f4aa_8bed_3eb6_757cd4990fab -->|calls| 041ca752_10c1_3cda_1f5c_02f44a01310e
  style f1ad8882_f4aa_8bed_3eb6_757cd4990fab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/BuildReactiveFunction.ts lines 1190–1220

  visitBreak(
    block: BlockId,
    id: InstructionId,
    loc: SourceLocation,
  ): ReactiveTerminalStatement<ReactiveBreakTerminal> | null {
    const target = this.cx.getBreakTarget(block);
    if (target === null) {
      CompilerError.invariant(false, {
        reason: 'Expected a break target',
        loc: GeneratedSource,
      });
    }
    if (this.cx.scopeFallthroughs.has(target.block)) {
      CompilerError.invariant(target.type === 'implicit', {
        reason: 'Expected reactive scope to implicitly break to fallthrough',
        loc,
      });
      return null;
    }
    return {
      kind: 'terminal',
      terminal: {
        kind: 'break',
        loc,
        target: target.block,
        id,
        targetKind: target.type,
      },
      label: null,
    };
  }

Domain

Subdomains

Called By

Frequently Asked Questions

What does visitBreak() do?
visitBreak() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/BuildReactiveFunction.ts.
Where is visitBreak() defined?
visitBreak() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/BuildReactiveFunction.ts at line 1190.
What does visitBreak() call?
visitBreak() calls 2 function(s): getBreakTarget, invariant.
What calls visitBreak()?
visitBreak() is called by 1 function(s): visitBlock.

Analyze Your Own Codebase

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

Try Supermodel Free