Mouse follower
✓ Published1🌍 Public
A circle follows the mouse cursor across an SVG canvas. The example demonstrates React state management for tracking pointer position and rendering a visual response. The component uses `useState` to store mouse coordinates and `useCallback` to handle the `onMouseMove` event, updating the circle's `cx` and `cy` attributes on each move. The SVG element listens for mouse events, and ReactDOM renders the interactive graphic. The circle is styled with a default black fill and no animation or smoothing, providing a direct, immediate link between input and visual output.
AI-generated descriptionA program that follows your mouse with a circle.
MIT Licensed