Tracks mouse position on an element or document body.
import { useMouse } from 'primereact/hooks';
Hover the mouse over the element to track the mouse position.
const { ref, x, y } = useMouse();
The reset callback is provided to clear the tracked mouse position.
const { ref, x, y } = useMouse();
When ref is not used, the document is used as the target.
const { x, y } = useMouse();