UNPKG

@supunlakmal/hooks

Version:

A collection of reusable React hooks

10 lines (9 loc) 479 B
import { RefObject } from 'react'; /** * Custom hook to detect whether a DOM element is being hovered over. * * @returns {[RefObject<T | null>, boolean]} A tuple containing: * - ref: A React ref object (possibly null initially) to attach to the target DOM element. * - isHovered: A boolean state indicating if the element is currently hovered. */ export declare const useHover: <T extends HTMLElement = HTMLElement>() => [RefObject<T | null>, boolean];