useScroll
warning
This hook is in the experimental stage.
- This is a hook that provides the
XandYcoordinates of the mouse within the browser viewport.
Features
-
It provides a
refto track the mouse position within a specific element, and if no element is referenced, it provides the mouse position within the document. -
It offers the
XandYcoordinates of the mouse.
Types
const useMouse: <T extends HTMLElement>() => {
x: number;
y: number;
ref: React.MutableRefObject<T | null>;
};