Loading...
The usesClickCoordinates hook is for capturing click coordinates, this is useful when positioning a tooptip or creating visual effects
where:
ref: node reference to observe the click event.
ref
handlerClick: Callback that receives the coordinates of the click event.
handlerClick
Where :
x: MouseEvent.clientX
y: MouseEvent.clientY
offset.x : MouseEvent.offsetX
import { useClickCoordinates } from "@atomico/hooks/use-click-coordinates";
useClickCoordinates(ref, handlerClick);
interface Coordinates { x: number; y: number; offset: { x: number; y: number; }; }