useHover
Provides a ref and a reactive boolean state indicating whether the attached element is currently being hovered over by a pointer.
Importing
1
import { useHover } from '@infinityfx/lively/hooks';Usage
Call signature
1
const [ref, hovering] = useHover<T extends HTMLElement>()
Returns
ref:
React.RefObject<T | null> A React ref to attach to the target DOM element.
hovering:
boolean A boolean value indicating if the element is currently hovered.