import { useHover } from "https://deno.land/x/netzo@0.4.72/deps/usehooks-ts.ts";
Custom hook for tracking whether a DOM element is being hovered over.
Examples
const buttonRef = useRef(null);
const isHovered = useHover(buttonRef);
// Access the isHovered variable to determine if the button is being hovered over.
const buttonRef = useRef(null); const isHovered = useHover(buttonRef); // Access the isHovered variable to determine if the button is being hovered over.
Parameters
elementRef: RefObject<T>
- The ref object for the DOM element to track.