@empathyco/x-components
Version:
Empathy X Components
27 lines (15 loc) • 773 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [getRootXComponent](./x-components.getrootxcomponent.md)
## getRootXComponent() function
Given a component, finds the root XComponent in the ancestors hierarchy.
**Signature:**
```typescript
export declare function getRootXComponent(component: ComponentPublicInstance | null): ComponentPublicInstance | undefined;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| component | ComponentPublicInstance \| null | The component to find its root XComponent. |
**Returns:**
ComponentPublicInstance \| undefined
The root XComponent or undefined if it has not.