Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
JJordan Trémoureux
Last edited Jul 6, 2022
Created on Feb 26, 2021
Forked from Mouse Follower

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 description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes