[Strict Mode] EuiMutationObserver doesn't work
- Dominant language
- TypeScript
- Stars
- 6.4k
- Forks
- 911
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 65
Description
**Describe the bug**
When Strict Mode is enabled, `EuiMutationObserver` doesn't work. Mutations are not being registered.
[Docs page](https://eui.elastic.co/docs/utilities/mutation-observer/)
| Strict Mode | No Strict Mode |
| ------------ | --------------- |
|  |  |
**Impact and severity**
It impacts all end-users of our consumers. **Severe**.
There is **no known workaround**.
[[Search](https://github.com/search?q=repo%3Aelastic%2Feui+%3CEuiMutationObserver&type=code)] `EuiMutationObserver` is used internally in:
- `EuiDataGrid` ([Kibana](https://github.com/search?q=repo%3Aelastic%2Fkibana+%3CEuiDataGrid&type=code), 71)
- `EuiPopover` ([Kibana](https://github.com/search?q=repo%3Aelastic%2Fkibana+%3CEuiPopover&type=code), 512)
[[Search](https://github.com/search?q=repo%3Aelastic%2Fkibana+%3CEuiMutationObserver&type=code)] `EuiMutationObserver` is used 2 times in Kibana
**Environment and versions**
- EUI version: ~
- React version: React 18 (Strict Mode)
- Kibana version (if applicable): ~
- Browser: ~
- Operating System: ~
**Minimum reproducible sandbox**
[Codesandbox](https://codesandbox.io/p/sandbox/frosty-brook-wc5dw6)
**To Reproduce**
1. Enable Strict Mode.
2. Render `EuiMutationObserver`.
3. Notice that the changes observed are not actually registered and output.
**Expected behavior**
`EuiMutationObserver` works correctly and changes are registered and output correctly.
Contributor guide
Assessment
This issue has not been assessed yet.