pub struct HookUse {
pub kind: HookUseKind,
pub dep_array_arity: Option<u32>,
pub span_start: u32,
pub component: String,
}Expand description
A React hook call site inside a component. Consumed by the complexity-fold phase (hook density) and surfaced as descriptive hotspot context.
Fields§
§kind: HookUseKindThe hook kind.
dep_array_arity: Option<u32>The dependency-array arity, recorded ONLY when a literal array is present
at the dependency-array position ([a, b] -> Some(2), [] ->
Some(0)). None when the call has no dependency array argument or the
argument is not a literal array (ADR-001: do not guess).
span_start: u32Start byte offset of the hook call (anchors findings).
component: StringThe enclosing component name (the top of the visitor’s component stack when the hook call was recorded). Lets the descriptive per-component hook summary attribute hooks exactly even when a file declares several components. A hook recorded outside any component carries an empty string (the visitor only records hooks inside a component, so this is the rare top-level / unattributed case).