UNPKG

common-hook

Version:
12 lines (11 loc) 302 B
export interface Options { onEnter?: () => void; onLeave?: () => void; onChange?: (isHovering: boolean) => void; } /** * @name 监听DOM元素是否鼠标悬停 * @example * const isHovering = useHover(ref) */ export declare const useHover: (target: any, options?: Options) => boolean;