Import this in your client-side component
MyComponent.tsx
import { useHover } from "react-amazing-hooks";
API
Api | Description | Type | Return Type | Example |
---|---|---|---|---|
useHover | A hook to detect if an element is hovered. | Target, OptionsUseOver | boolean | const isHovered = useHover('#myElement', { delay: 200 }); |
Check the OptionsUseOver
in the 'Types' tab.
Check the 'Example' tab above the table for an exhaustive example. *