Skip to main content
child
() => Component
required
A function that returns a component. The function is inspected (not executed) to extract the component’s AST data.

Returns

A ComponentData object:
name
string | null
The component name, or null if the AST node could not be resolved.
props
Record<string, any>
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, name will be null.
  • 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").