Home / File/ reactivity-analysis-interleaved-reactivity.js — react Source File

reactivity-analysis-interleaved-reactivity.js — react Source File

Architecture documentation for reactivity-analysis-interleaved-reactivity.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

function Component(props) {
  // a and b are technically independent, but their mutation is interleaved
  // so they are grouped in a single reactive scope. a does not have any
  // reactive inputs, but b does. therefore, we have to treat a as reactive,
  // since it will be recreated based on a reactive input.
  const a = {};
  const b = [];
  b.push(props.b);
  a.a = null;

  // because a may recreate when b does, it becomes reactive. we have to recreate
  // c if a changes.
  const c = [a];

  // Example usage that could fail if we didn't treat a as reactive:
  //  const [c, a] = Component({b: ...});
  //  assert(c[0] === a);
  return [c, a];
}

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

Subdomains

Functions

Frequently Asked Questions

What does reactivity-analysis-interleaved-reactivity.js do?
reactivity-analysis-interleaved-reactivity.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 reactivity-analysis-interleaved-reactivity.js?
reactivity-analysis-interleaved-reactivity.js defines 1 function(s): Component.
Where is reactivity-analysis-interleaved-reactivity.js in the architecture?
reactivity-analysis-interleaved-reactivity.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactivity-analysis-interleaved-reactivity.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