React hook that implements hoverIntent behavior, delaying hover callbacks until the user's mouse slows down. Version 1.3.0 supports ESM and CommonJS, includes TypeScript types, and has zero dependencies. Released roughly every few months with maintenance updates. Differentiates from alternatives by being a lightweight hook with no external runtime requirements, inspired by jQuery hoverIntent.
npm install react-use-hoverintentNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage of useHoverIntent hook with custom options, showing isHovering state and ref.
Upgrade to v1.2.9+ and ensure array destructuring order matches documentation: [isHovering, intentRef, setIsHovering]
Avoid using setIsHovering unless absolutely necessary; prefer relying on hover intent callbacks.
Pass ref option to useHoverIntent({ref: forwardedRef}) and ensure intentRef is used on DOM element.Ensure useHoverIntent is called inside a React functional component. Check that intentRef is correctly destructured: const [isHovering, intentRef] = useHoverIntent();
Use React.forwardRef on custom components and pass intentRef to the underlying DOM element.
Use import { useHoverIntent } from 'react-use-hoverintent'No dependency data recorded yet.