Home / Function/ hasNonVoidReturn() — react Function Reference

hasNonVoidReturn() — react Function Reference

Architecture documentation for the hasNonVoidReturn() function in ValidateUseMemo.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4117cd56_ad20_df31_ff25_2a7a507a699a["hasNonVoidReturn()"]
  50f9142a_be38_a654_5f39_5cea59a5336d["ValidateUseMemo.ts"]
  4117cd56_ad20_df31_ff25_2a7a507a699a -->|defined in| 50f9142a_be38_a654_5f39_5cea59a5336d
  67b24411_23d5_6f16_8d4e_dbebeb847123["validateUseMemo()"]
  67b24411_23d5_6f16_8d4e_dbebeb847123 -->|calls| 4117cd56_ad20_df31_ff25_2a7a507a699a
  style 4117cd56_ad20_df31_ff25_2a7a507a699a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateUseMemo.ts lines 216–228

function hasNonVoidReturn(func: HIRFunction): boolean {
  for (const [, block] of func.body.blocks) {
    if (block.terminal.kind === 'return') {
      if (
        block.terminal.returnVariant === 'Explicit' ||
        block.terminal.returnVariant === 'Implicit'
      ) {
        return true;
      }
    }
  }
  return false;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does hasNonVoidReturn() do?
hasNonVoidReturn() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateUseMemo.ts.
Where is hasNonVoidReturn() defined?
hasNonVoidReturn() is defined in compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateUseMemo.ts at line 216.
What calls hasNonVoidReturn()?
hasNonVoidReturn() is called by 1 function(s): validateUseMemo.

Analyze Your Own Codebase

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

Try Supermodel Free