Mouse Follower
✓ Published1🌍 Public
A circle follows the mouse cursor across an SVG canvas. The example demonstrates state management in React, using the `useState` hook to track cursor coordinates and the `useCallback` hook to optimize the mouse move event handler. React renders the circle's position dynamically with a 20-pixel radius, starting at the center of a 960 by 500 viewport. The code uses React 16.9 and ReactDOM to render the SVG element, updating the circle's `cx` and `cy` attributes on every `mousemove` event.
AI-generated descriptionA program that follows your mouse with a circle.
MIT Licensed