Interaction in React
✓ Published0🌍 Public
A circle inside an SVG element follows the mouse cursor across a 960-by-500 canvas, updating its center position in real time. The React component uses the `useState` hook to store the cursor’s `clientX` and `clientY` coordinates, which are set by the `onMouseMove` event handler on the `<svg>`. The circle’s `cx` and `cy` attributes are bound to this state, and React’s `ReactDOM.render` mounts the component to the `#root` div. The rendering is purely SVG-based, with no external data source.
AI-generated descriptionReact Starter code.
MIT Licensed