🌍 Public
Viewing a saved revision (read-only)
59c35ef2d0bd4347882f9a964f0c03de
Fork of React Starter
This example shows a single circle following the mouse as it moves across an SVG canvas. The circle’s position updates continuously based on the cursor’s client coordinates, shifting smoothly across a 960×500 viewport. The visualization uses React’s `useState` and `useCallback` hooks to manage and update the mouse position, while `ReactDOM.render` mounts the component into the DOM. The SVG `<circle>` element is rendered directly, with its `cx` and `cy` attributes bound to the current mouse coordinates.
AI-generated descriptionReact Starter code.