🌍 Public
Viewing a saved revision (read-only)
a8a9da0627004b4eb0f002ad8de9d658
Mouse Follower
The example shows a black circle that follows the mouse cursor across a blank SVG canvas, updating its position in real time as the pointer moves. The code uses React hooks, specifically `useState` and `useCallback`, to track the mouse coordinates and re-render the circle’s `cx` and `cy` attributes on every move event. It renders a 960×500 SVG element with a single circle of radius 30, and the mouse position is captured via the `onMouseMove` handler.
AI-generated descriptionA program that follows your mouse with a circle