@pastable/react
Version:
7 lines (6 loc) • 356 B
TypeScript
import { MouseEvent, MutableRefObject } from "react";
/**
* Detect and invoke a callback when clicking away of target element.
* @see Adapted from https://github.com/streamich/react-use
*/
export declare const useClickAway: (ref: MutableRefObject<any>, onClickAway: (event: MouseEvent) => void, events?: Array<keyof HTMLElementEventMap>) => void;