rooks
Version:
Collection of awesome react hooks
11 lines (10 loc) • 394 B
TypeScript
/**
* useOnClickRef hook
*
* This hook runs a callback for both clicks and tap events when the element is clicked or tapped.
*
* @param {Function} onClick The callback function to run on click or tap
* @returns {Function} A callback ref which can be attached to an element
*/
declare function useOnClickRef(onClick: () => void): (element: HTMLElement) => void;
export { useOnClickRef };