Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse follower

Public visualization

Viewing a saved revision (read-only)

4522d4ae1c1742a69c2fec7a22ad9341

Mouse follower

0 stars1🌍 Public
PPetko4
Last edited Jul 31, 2022
Created on Jul 31, 2022

A single black circle follows the mouse cursor across a blank SVG canvas, updating its position in real time. The React app tracks pointer coordinates through an `onMouseMove` event handler and stores them in state with `useState`, then re-renders the circle using the `clientX` and `clientY` values. The example demonstrates a basic interactive pattern using React’s `useCallback` and ReactDOM, with SVG circle elements for rendering.

AI-generated description