ValueReason Type — react Architecture
Architecture documentation for the ValueReason type/interface in HIR.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 358e8ce3_19a4_3e01_1d6a_85100cffaccd["ValueReason"] 18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"] 358e8ce3_19a4_3e01_1d6a_85100cffaccd -->|defined in| 18a78965_f593_105b_e5e8_07001321c2ec style 358e8ce3_19a4_3e01_1d6a_85100cffaccd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts lines 1420–1472
export enum ValueReason {
/**
* Defined outside the React function.
*/
Global = 'global',
/**
* Used in a JSX expression.
*/
JsxCaptured = 'jsx-captured',
/**
* Argument to a hook
*/
HookCaptured = 'hook-captured',
/**
* Return value of a hook
*/
HookReturn = 'hook-return',
/**
* Passed to an effect
*/
Effect = 'effect',
/**
* Return value of a function with known frozen return value, e.g. `useState`.
*/
KnownReturnSignature = 'known-return-signature',
/**
* A value returned from `useContext`
*/
Context = 'context',
/**
* A value returned from `useState`
*/
State = 'state',
/**
* A value returned from `useReducer`
*/
ReducerState = 'reducer-state',
/**
* Props of a component or arguments of a hook.
*/
ReactiveFunctionArgument = 'reactive-function-argument',
Other = 'other',
}
Source
Frequently Asked Questions
What is the ValueReason type?
ValueReason is a type/interface in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts.
Where is ValueReason defined?
ValueReason is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts at line 1420.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free