FCC: Mouse follower using React
✓ Published1🌍 Public
A single black circle follows the mouse cursor across a full-window SVG canvas. The React component tracks pointer coordinates via an `onMouseMove` handler, storing them in state with the `useState` hook and updating them through a `useCallback`-wrapped event listener. The circle’s `cx` and `cy` attributes are re-rendered with each mouse movement, using the viewport dimensions from `window.innerWidth` and `window.innerHeight`. The example demonstrates React’s declarative UI updates for interactive SVG visualizations.
AI-generated descriptionFCC: Mouse follower using React
MIT Licensed