Home / Function/ evaluatesToStableTypeOrContainer() — react Function Reference

evaluatesToStableTypeOrContainer() — react Function Reference

Architecture documentation for the evaluatesToStableTypeOrContainer() function in HIR.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8838ac7e_69f8_3c78_b8c7_7b272e305ef9["evaluatesToStableTypeOrContainer()"]
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  8838ac7e_69f8_3c78_b8c7_7b272e305ef9 -->|defined in| 18a78965_f593_105b_e5e8_07001321c2ec
  9cbd2355_05cd_5bbd_253f_7aeb4f947484["getHookKind()"]
  8838ac7e_69f8_3c78_b8c7_7b272e305ef9 -->|calls| 9cbd2355_05cd_5bbd_253f_7aeb4f947484
  style 8838ac7e_69f8_3c78_b8c7_7b272e305ef9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts lines 1927–1947

export function evaluatesToStableTypeOrContainer(
  env: Environment,
  {value}: Instruction,
): boolean {
  if (value.kind === 'CallExpression' || value.kind === 'MethodCall') {
    const callee =
      value.kind === 'CallExpression' ? value.callee : value.property;

    const calleeHookKind = getHookKind(env, callee.identifier);
    switch (calleeHookKind) {
      case 'useState':
      case 'useReducer':
      case 'useActionState':
      case 'useRef':
      case 'useTransition':
      case 'useOptimistic':
        return true;
    }
  }
  return false;
}

Subdomains

Frequently Asked Questions

What does evaluatesToStableTypeOrContainer() do?
evaluatesToStableTypeOrContainer() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts.
Where is evaluatesToStableTypeOrContainer() defined?
evaluatesToStableTypeOrContainer() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts at line 1927.
What does evaluatesToStableTypeOrContainer() call?
evaluatesToStableTypeOrContainer() calls 1 function(s): getHookKind.

Analyze Your Own Codebase

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

Try Supermodel Free