Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
CChaBoiYungMoney
Last edited Apr 19, 2022
Created on Apr 19, 2022

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 description

A program that follows your mouse with a circle

MIT Licensed

Similar vizzes