Home / Function/ doesPatternContainSpreadElement() — react Function Reference

doesPatternContainSpreadElement() — react Function Reference

Architecture documentation for the doesPatternContainSpreadElement() function in visitors.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  f4ce4a75_9bb6_f3be_c3c6_eb60cb87ce0e["doesPatternContainSpreadElement()"]
  2f3caf55_cc64_415c_55dd_9771ba7dc210["visitors.ts"]
  f4ce4a75_9bb6_f3be_c3c6_eb60cb87ce0e -->|defined in| 2f3caf55_cc64_415c_55dd_9771ba7dc210
  25afae47_3217_0d09_3179_995552e8b339["mayAllocate()"]
  25afae47_3217_0d09_3179_995552e8b339 -->|calls| f4ce4a75_9bb6_f3be_c3c6_eb60cb87ce0e
  d7fde76c_4fd9_feb3_299b_798689f05bc6["assertExhaustive()"]
  f4ce4a75_9bb6_f3be_c3c6_eb60cb87ce0e -->|calls| d7fde76c_4fd9_feb3_299b_798689f05bc6
  style f4ce4a75_9bb6_f3be_c3c6_eb60cb87ce0e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts lines 304–330

export function doesPatternContainSpreadElement(pattern: Pattern): boolean {
  switch (pattern.kind) {
    case 'ArrayPattern': {
      for (const item of pattern.items) {
        if (item.kind === 'Spread') {
          return true;
        }
      }
      break;
    }
    case 'ObjectPattern': {
      for (const property of pattern.properties) {
        if (property.kind === 'Spread') {
          return true;
        }
      }
      break;
    }
    default: {
      assertExhaustive(
        pattern,
        `Unexpected pattern kind \`${(pattern as any).kind}\``,
      );
    }
  }
  return false;
}

Subdomains

Called By

Frequently Asked Questions

What does doesPatternContainSpreadElement() do?
doesPatternContainSpreadElement() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts.
Where is doesPatternContainSpreadElement() defined?
doesPatternContainSpreadElement() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts at line 304.
What does doesPatternContainSpreadElement() call?
doesPatternContainSpreadElement() calls 1 function(s): assertExhaustive.
What calls doesPatternContainSpreadElement()?
doesPatternContainSpreadElement() is called by 1 function(s): mayAllocate.

Analyze Your Own Codebase

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

Try Supermodel Free