Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Jjeffmesie
Last edited Aug 23, 2021
Created on Aug 23, 2021

A circle remains fixed at the center of an SVG while React tracks the mouse position and updates the component's state. The example shows a simple interactive visualization where the cursor's coordinates are captured through the `onMouseMove` event, rendering a static shape rather than moving the circle itself. Using React 16.9 with hooks like `useState` and `useCallback`, it demonstrates a minimal state-driven component structure in ReactDOM, rendering SVG elements with hardcoded dimensions (960×500) and a circle of radius 30 pixels.

AI-generated description

A program that follows your mouse with a circle

MIT Licensed

Similar vizzes