Mouse Follower
✓ Published1🌍 Public
A yellow circle follows the mouse cursor across a blank SVG canvas. The example demonstrates mouse tracking in React by updating the circle’s center coordinates on every pointer move. It uses React’s `useState` and `useCallback` hooks, with the `onMouseMove` event handler reading `clientX` and `clientY` from the event object to re-render the circle. The SVG is rendered via ReactDOM, and the initial circle position is centered within a 960×500 viewport.
AI-generated descriptionA program that follows your mouse with a circle.
MIT Licensed