Home / Type/ ErrorCategory Type — react Architecture

ErrorCategory Type — react Architecture

Architecture documentation for the ErrorCategory type/interface in CompilerError.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a2b91621_58d3_1d04_4663_00cd808f1034["ErrorCategory"]
  e96f281e_f381_272d_2359_3e6a091c9a1d["CompilerError.ts"]
  a2b91621_58d3_1d04_4663_00cd808f1034 -->|defined in| e96f281e_f381_272d_2359_3e6a091c9a1d
  style a2b91621_58d3_1d04_4663_00cd808f1034 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/CompilerError.ts lines 619–733

export enum ErrorCategory {
  /**
   * Checking for valid hooks usage (non conditional, non-first class, non reactive, etc)
   */
  Hooks = 'Hooks',
  /**
   * Checking for no capitalized calls (not definitively an error, hence separating)
   */
  CapitalizedCalls = 'CapitalizedCalls',
  /**
   * Checking for static components
   */
  StaticComponents = 'StaticComponents',
  /**
   * Checking for valid usage of manual memoization
   */
  UseMemo = 'UseMemo',
  /**
   * Checking that useMemos always return a value
   */
  VoidUseMemo = 'VoidUseMemo',
  /**
   * Checking for higher order functions acting as factories for components/hooks
   */
  Factories = 'Factories',
  /**
   * Checks that manual memoization is preserved
   */
  PreserveManualMemo = 'PreserveManualMemo',
  /**
   * Checks for exhaustive useMemo/useCallback dependencies without extraneous values
   */
  MemoDependencies = 'MemoDependencies',
  /**
   * Checks for known incompatible libraries
   */
  IncompatibleLibrary = 'IncompatibleLibrary',
  /**
   * Checking for no mutations of props, hook arguments, hook return values
   */
  Immutability = 'Immutability',
  /**
   * Checking for assignments to globals
   */
  Globals = 'Globals',
  /**
   * Checking for valid usage of refs, ie no access during render
   */
  Refs = 'Refs',
  /**
   * Checks for memoized effect deps
   */
  EffectDependencies = 'EffectDependencies',
  /**
   * Checks for exhaustive and extraneous effect dependencies
   */
  EffectExhaustiveDependencies = 'EffectExhaustiveDependencies',
  /**
   * Checks for no setState in effect bodies
   */
  EffectSetState = 'EffectSetState',
  EffectDerivationsOfState = 'EffectDerivationsOfState',
  /**
   * Validates against try/catch in place of error boundaries
   */
  ErrorBoundaries = 'ErrorBoundaries',
  /**
   * Checking for pure functions
   */
  Purity = 'Purity',
  /**
   * Validates against setState in render
   */
  RenderSetState = 'RenderSetState',
  /**
   * Internal invariants
   */
  Invariant = 'Invariant',
  /**
   * Todos
   */

Frequently Asked Questions

What is the ErrorCategory type?
ErrorCategory is a type/interface in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/CompilerError.ts.
Where is ErrorCategory defined?
ErrorCategory is defined in compiler/packages/babel-plugin-react-compiler/src/CompilerError.ts at line 619.

Analyze Your Own Codebase

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

Try Supermodel Free