useTest() — react Function Reference
Architecture documentation for the useTest() function in repro-allocating-ternary-test-instruction-scope.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 8474bc55_753f_0b3e_908b_4026a40a0ab2["useTest()"] 337c761a_dd8a_34d3_a236_bd6a494bba99["repro-allocating-ternary-test-instruction-scope.ts"] 8474bc55_753f_0b3e_908b_4026a40a0ab2 -->|defined in| 337c761a_dd8a_34d3_a236_bd6a494bba99 802797f6_56a4_9efc_c6fb_f465c8b87240["useHook()"] 8474bc55_753f_0b3e_908b_4026a40a0ab2 -->|calls| 802797f6_56a4_9efc_c6fb_f465c8b87240 style 8474bc55_753f_0b3e_908b_4026a40a0ab2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-allocating-ternary-test-instruction-scope.ts lines 5–17
function useTest({cond}) {
const val = makeObject_Primitives();
useHook();
/**
* We don't technically need a reactive scope for this ternary as
* it cannot produce newly allocated values.
* While identity(...) may allocate, we can teach the compiler that
* its result is only used as as a test condition
*/
const result = identity(cond) ? val : null;
return result;
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does useTest() do?
useTest() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-allocating-ternary-test-instruction-scope.ts.
Where is useTest() defined?
useTest() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-allocating-ternary-test-instruction-scope.ts at line 5.
What does useTest() call?
useTest() calls 1 function(s): useHook.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free