@empathyco/x-components
Version:
Empathy X Components
57 lines (27 loc) • 908 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
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
component
</td><td>
ComponentPublicInstance \| null
</td><td>
The component to find its root XComponent.
</td></tr>
</tbody></table>
**Returns:**
ComponentPublicInstance \| undefined
The root XComponent or undefined if it has not.