Mouse Follower
✓ Published1🌍 Public
A React component renders a 960-by-500 SVG containing a single circle that follows the mouse cursor across the viewport. The circle’s center coordinates are tracked via React’s `useState` hook, updated on every `mousemove` event through a `useCallback` handler that reads `clientX` and `clientY`. The SVG element listens for the mouse movement, and the circle’s `cx` and `cy` attributes are bound to the current position state. The code uses React 16.9 and `ReactDOM.render` to display the interactive graphic.
AI-generated descriptionA program that follows your mouse with a circle.
MIT Licensed