UNSAFE_HOST_DOM: Component touches the page's DOM
| Severity | Fault | Stage |
|---|---|---|
| error | customer (the source package) | build output |
What it means
Section titled “What it means”The component reaches the host page’s DOM outside its shadow root (document.body, document.head, document.documentElement, document.querySelector, getElementById and the like), where it can change or read the site’s own content (rule dom-outside-shadow-root).
How to fix
Section titled “How to fix”Render only inside the component with JSX; to reach the component’s own element, use useHost().element, and for the page’s language use useLocale.