Mouse Follower
✓ Published0🌍 Public
A yellow circle follows the mouse cursor across an SVG canvas. The example demonstrates how React manages interactive state by tracking the cursor’s position through the `onMouseMove` event. The `useState` hook stores the mouse coordinates, which update the circle’s `cx` and `cy` attributes on every movement. The application uses React 16.9 and ReactDOM to render the SVG element directly in the browser, with the circle’s position reset to the center of the 960 by 500 viewport on load.
AI-generated descriptionA program that follows your mouse with a circle
MIT Licensed