Home / Function/ Component() — react Function Reference

Component() — react Function Reference

Architecture documentation for the Component() function in dont-merge-if-dep-is-inner-declaration-of-previous-scope.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  886508ff_979c_3b42_c7bb_21a99e44010b["Component()"]
  75e2aa24_423e_d362_3683_b9214f34a1c3["dont-merge-if-dep-is-inner-declaration-of-previous-scope.js"]
  886508ff_979c_3b42_c7bb_21a99e44010b -->|defined in| 75e2aa24_423e_d362_3683_b9214f34a1c3
  style 886508ff_979c_3b42_c7bb_21a99e44010b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dont-merge-if-dep-is-inner-declaration-of-previous-scope.js lines 6–25

function Component({a, b, c}) {
  const x = [];
  let y;
  if (a) {
    y = [b];
  }
  x.push(c);

  // this scope should not merge with the above scope because y does not invalidate
  // on changes to `c`
  const z = [y];

  // return [x, z];
  return (
    <>
      <ValidateMemoization inputs={[a, b, c]} output={x} />
      <ValidateMemoization inputs={[a, b]} output={z} />
    </>
  );
}

Subdomains

Frequently Asked Questions

What does Component() do?
Component() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dont-merge-if-dep-is-inner-declaration-of-previous-scope.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dont-merge-if-dep-is-inner-declaration-of-previous-scope.js at line 6.

Analyze Your Own Codebase

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

Try Supermodel Free