[BUG] useHover is "stuck" on true
value if the hovered element is removed from the DOM
#643
Labels
bug
Something isn't working
Describe the bug
I have a scenario where, when I hover on an element (container), something else is rendered adjacent to it.
This hovered container contains a button as well as more stuff, and when clicking on the button, the view changes.
The issue is that if I click the button and the view changes, and therefore the hovered ref is removed.
To Reproduce
https://stackblitz.com/edit/vitejs-vite-sxroxj?file=src%2Ftest.tsx&terminal=dev
once input is hovered and
showInput
becomes false,isHovered
would stay stuck ontrue
Expected behavior
I guess the hook should be familiar with the fact its ref no longer exists in the DOM?
Additional context
No response
The text was updated successfully, but these errors were encountered: