🌍 Public
Viewing a saved revision (read-only)
eb40b08c13bb4c208d44ce48cb8454b1
Mouse Follower Refactor
This example demonstrates a circle that tracks the user’s mouse movements across an SVG canvas, updating its position in real time. Using React’s `useState` and `useCallback` hooks, the app captures `clientX` and `clientY` coordinates from the `onMouseMove` event and passes them as `cx` and `cy` attributes to the circle element. The rendering relies on React 16.9 and ReactDOM, with no additional data sources or visualization libraries involved.
AI-generated descriptionA program that follows your mouse with a circle.