merge-uncond-optional-chain-and-cond.ts — react Source File
Architecture documentation for merge-uncond-optional-chain-and-cond.ts, a typescript file in the react codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 035110c3_bbad_3aef_5668_3fe5332ab09d["merge-uncond-optional-chain-and-cond.ts"] 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"] 035110c3_bbad_3aef_5668_3fe5332ab09d --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05 style 035110c3_bbad_3aef_5668_3fe5332ab09d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
// @enablePropagateDepsInHIR
import {identity} from 'shared-runtime';
/**
* Very contrived text fixture showing that it's technically incorrect to merge
* a conditional dependency (e.g. dep.path in `cond ? dep.path : ...`) and an
* unconditionally evaluated optional chain (`dep?.path`).
*
*
* when screen is non-null, useFoo returns { title: null } or "(not null)"
* when screen is null, useFoo throws
*/
function useFoo({screen}: {screen: null | undefined | {title_text: null}}) {
return screen?.title_text != null
? '(not null)'
: identity({title: screen.title_text});
}
export const FIXTURE_ENTRYPOINT = {
fn: useFoo,
params: [{screen: null}],
sequentialRenders: [{screen: {title_bar: undefined}}, {screen: null}],
};
Domain
Subdomains
Functions
Dependencies
- shared-runtime
Source
Frequently Asked Questions
What does merge-uncond-optional-chain-and-cond.ts do?
merge-uncond-optional-chain-and-cond.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 merge-uncond-optional-chain-and-cond.ts?
merge-uncond-optional-chain-and-cond.ts defines 1 function(s): useFoo.
What does merge-uncond-optional-chain-and-cond.ts depend on?
merge-uncond-optional-chain-and-cond.ts imports 1 module(s): shared-runtime.
Where is merge-uncond-optional-chain-and-cond.ts in the architecture?
merge-uncond-optional-chain-and-cond.ts is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/reduce-reactive-deps/merge-uncond-optional-chain-and-cond.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