Understand Component Labels and Output Formats
mainThe CLI uses specific notation to represent the React tree and component metadata.
Component Labels
Every component is assigned a stable label (e.g., @c1, @c2). Use these labels to target components in subsequent commands.
Type Abbreviations
In the tree output, component types are indicated by:
fn: Function componentcls: Class componenthost: DOM element (e.g.,div)memo:React.memocomponentfRef:forwardRefcomponentsusp:Suspensecomponentctx: Context provider
Error Annotations
⚠<N>: Indicates<N>warnings.✗<N>: Indicates<N>errors.
Inspected Component Data
When running get component <Label>, the output includes:
props: Current properties passed to the component.state: Current component state.hooks: Current values of hooks (e.g.,useState,useMemo).ƒ: Represents a function value.
Profiling Render Causes
Profiling output identifies why a component re-rendered using these causes:
props-changed: A prop value changed.state-changed: Local state changed.hooks-changed: A hook value changed.parent-rendered: The parent component re-rendered.force-update: A manual force update was triggered.first-mount: The component was mounted for the first time.