A function that returns a component. The function is inspected (not executed) to extract the component’s AST data.
Returns
AComponentData object:
The component name, or
null if the AST node could not be resolved.The component’s props as a key-value object.
Usage
Extract component information
Inspect modified components
The function unwraps modifiers to find the core component:Conditional rendering based on child type
Notes
- Modifiers are automatically unwrapped to find the core component.
- If the component cannot be identified,
namewill benull. - The returned props are the direct props passed to the component, not computed values.
- Custom components defined with defineComponent return their registered name.
- Built-in components return their standard names (e.g.,
"Text","Image","VStack").