useMouse ​
Hook that manages a mouse position
typescript
import { useMouse } from '@siberiacancode/reactuse';
Usage ​
typescript
const { x, y, elementX, elementY, elementPositionX, elementPositionY } = useMouse(target);
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
target | Target | - | The target element to manage the mouse position for |