Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
AAlbert
Last edited Nov 24, 2021
Created on Nov 24, 2021
Forked from React Starter

A circle follows the mouse cursor as it moves across an SVG canvas, changing its fill color randomly with each click. Built with React hooks `useState` and `useCallback`, the component tracks pointer coordinates via the `onMouseMove` event and updates the circle's `cx` and `cy` attributes. Mouse clicks trigger a `setColor` update that generates a random HSL hue value, demonstrating reactive SVG rendering within a React framework.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes