Home / File/ memberexpr-join-optional-chain.ts — react Source File

memberexpr-join-optional-chain.ts — react Source File

Architecture documentation for memberexpr-join-optional-chain.ts, a typescript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

// @enablePropagateDepsInHIR
// To preserve the nullthrows behavior and reactive deps of this code,
// Forget needs to add `props.a.b` or a subpath as a dependency.
//
// (1) Since the reactive block producing x unconditionally read props.a.<...>,
//     reading `props.a.b` outside of the block would still preserve nullthrows
//     semantics of source code
// (2) Technically, props.a, props.a.b, and props.a.b.c are all reactive deps.
//     However, `props.a?.b` is only dependent on whether `props.a` is nullish,
//     not its actual value. Since we already preserve nullthrows on `props.a`,
//     we technically do not need to add `props.a` as a dependency.

function Component(props) {
  let x = [];
  x.push(props.a?.b);
  x.push(props.a.b.c);
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{a: {b: {c: 1}}}],
};

Subdomains

Functions

Frequently Asked Questions

What does memberexpr-join-optional-chain.ts do?
memberexpr-join-optional-chain.ts is a source file in the react codebase, written in typescript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in memberexpr-join-optional-chain.ts?
memberexpr-join-optional-chain.ts defines 1 function(s): Component.
Where is memberexpr-join-optional-chain.ts in the architecture?
memberexpr-join-optional-chain.ts is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/reduce-reactive-deps/memberexpr-join-optional-chain.ts (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/reduce-reactive-deps).

Analyze Your Own Codebase

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

Try Supermodel Free