eui
eui copied to clipboard
[EuiFlyout] The test-env variation isn't wrapped in `forwardRef`
Describe the bug
When rendering EuiFlyoutResizable in the jest test environment, it results in the following warning being printed out:
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
The cause is the difference in implementation between the regular EuiFlyout (flyout.tsx) and the test-env variant (flyout.testenv.tsx). The latter is not wrapped in forwardRef(), which causes the warning to be printed out.
Impact and severity
End users are not affected by this bug. The warning is only printed out when the test-env build is used.
Environment and versions
- EUI version: 101.3.0 / latest
- React version: 18.2.0
- Kibana version (if applicable): latest
- Browser: NA
- Operating System: MacOS
Expected behavior
The test-env build should not warn about the ref prop being passed internally by EuiFlyoutResizable.
Additional context Add any other context about the problem here.
@tkajtoch can I do it
@pukarlamichhane go for it!
I am happy to work on a PR for this issue!