Home / File/ same-variable-as-dep-and-redeclare-maybe-frozen.js — react Source File

same-variable-as-dep-and-redeclare-maybe-frozen.js — react Source File

Architecture documentation for same-variable-as-dep-and-redeclare-maybe-frozen.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

// note: comments are for the ideal scopes, not what is currently
// emitted
function foo(props) {
  // scope 0: deps=[props.a] decl=[x] reassign=none
  let x = [];
  x.push(props.a);

  // scope 1: deps=[x] decl=[header] reassign=none
  const header = props.showHeader ? <div>{x}</div> : null;

  // scope 2:
  // deps=[x, props.b, props.c]
  // decl=none
  // reassign=[x]
  const y = [x]; // y depends on the earlier x
  x = []; // x reassigned
  y.push(props.b); // interleaved mutation of x/y
  x.push(props.c); // interleaved mutation

  // scope 3 ...
  const content = (
    <div>
      {x}
      {y}
    </div>
  );

  // scope 4 ...
  return (
    <>
      {header}
      {content}
    </>
  );
}

export const FIXTURE_ENTRYPOINT = {
  fn: foo,
  params: ['TodoAdd'],
  isComponent: 'TodoAdd',
};

Subdomains

Functions

Frequently Asked Questions

What does same-variable-as-dep-and-redeclare-maybe-frozen.js do?
same-variable-as-dep-and-redeclare-maybe-frozen.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in same-variable-as-dep-and-redeclare-maybe-frozen.js?
same-variable-as-dep-and-redeclare-maybe-frozen.js defines 1 function(s): foo.
Where is same-variable-as-dep-and-redeclare-maybe-frozen.js in the architecture?
same-variable-as-dep-and-redeclare-maybe-frozen.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/same-variable-as-dep-and-redeclare-maybe-frozen.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).

Analyze Your Own Codebase

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

Try Supermodel Free