UNPKG

rooks

Version:

Essential React custom hooks ⚓ to super charge your components!

13 lines 657 B
import type { CallbackRef } from "../utils/utils"; /** * useOutsideClickRef hook * Checks if a click happened outside a Ref. Handy for dropdowns, modals and popups etc. * * @param handler Callback to fire on outside click * @param when A boolean which which activates the hook only when it is true. Useful for conditionally enable the outside click * @returns An array with first item being ref * @see https://rooks.vercel.app/docs/useOutsideClick */ declare function useOutsideClickRef(handler: (event: MouseEvent | TouchEvent) => void, when?: boolean): [CallbackRef]; export { useOutsideClickRef }; //# sourceMappingURL=useOutsideClickRef.d.ts.map