reactive-control-dependency-from-interleaved-reactivity-do-while.js — react Source File
Architecture documentation for reactive-control-dependency-from-interleaved-reactivity-do-while.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
function Component(props) {
// a and b are independent but their mutations are interleaved, so
// they get grouped in a reactive scope. this means that a becomes
// reactive since it will effectively re-evaluate based on a reactive
// input
const a = [];
const b = [];
b.push(props.cond);
a.push(false);
// Downstream consumer of a, which initially seems non-reactive except
// that a becomes reactive, per above
const c = [a];
let x = 0;
do {
x += 1;
} while (c[0][0]);
// The values assigned to `x` are non-reactive, but the value of `x`
// depends on the "control" value `c[0]` which becomes reactive via
// being interleaved with `b`.
// Therefore x should be treated as reactive too.
return [x];
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{cond: true}],
};
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does reactive-control-dependency-from-interleaved-reactivity-do-while.js do?
reactive-control-dependency-from-interleaved-reactivity-do-while.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 reactive-control-dependency-from-interleaved-reactivity-do-while.js?
reactive-control-dependency-from-interleaved-reactivity-do-while.js defines 1 function(s): Component.
Where is reactive-control-dependency-from-interleaved-reactivity-do-while.js in the architecture?
reactive-control-dependency-from-interleaved-reactivity-do-while.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-from-interleaved-reactivity-do-while.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