Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
Kkatebacon32
Last edited Mar 29, 2021
Created on Mar 29, 2021

A yellow circle tracks the cursor across a 960 by 500 SVG canvas, updating its center position in real time. The React component uses the `useState` and `useCallback` hooks to manage mouse coordinates from the SVG `onMouseMove` event. Each pointer movement triggers a state update, which re-renders the circle’s `cx` and `cy` attributes via ReactDOM’s declarative rendering.

AI-generated description

A program that follows the mouse with a circle.

MIT Licensed

Similar vizzes