Home / Type/ State Type — react Architecture

State Type — react Architecture

Architecture documentation for the State type/interface in PropagateEarlyReturns.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  78af0c7c_8648_86d7_3f73_237950038f19["State"]
  adcc884e_716d_15ed_4c6a_2983e4feb77c["PropagateEarlyReturns.ts"]
  78af0c7c_8648_86d7_3f73_237950038f19 -->|defined in| adcc884e_716d_15ed_4c6a_2983e4feb77c
  style 78af0c7c_8648_86d7_3f73_237950038f19 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PropagateEarlyReturns.ts lines 108–124

type State = {
  /**
   * Are we within a reactive scope? We use this for two things:
   * - When we find an early return, transform it to an assign+break
   *   only if we're in a reactive scope
   * - Annotate reactive scopes that contain early returns...but only
   *   the outermost reactive scope, we can't do this for nested
   *   scopes.
   */
  withinReactiveScope: boolean;

  /**
   * Store early return information to bubble it back up to the outermost
   * reactive scope
   */
  earlyReturnValue: ReactiveScope['earlyReturnValue'];
};

Frequently Asked Questions

What is the State type?
State is a type/interface in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PropagateEarlyReturns.ts.
Where is State defined?
State is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PropagateEarlyReturns.ts at line 108.

Analyze Your Own Codebase

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

Try Supermodel Free