Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Interaction with React

Public visualization

Viewing a saved revision (read-only)

e7ba5d65c3824233a0131fe1fba41b12

Mouse Interaction with React

0 stars1🌍 Public
RRajaeKrib
Last edited Aug 15, 2021
Created on Aug 15, 2021
Forked from React Starter

A circle rendered as an SVG element follows the mouse cursor within a fixed 900×500 viewport. The React component `App` tracks pointer coordinates via an `onMouseMove` handler, updating the circle's `cx` and `cy` attributes through state managed by `useState`. The initial position is centered at half the width and height. React 16.13.1 and ReactDOM render the interactive graphic, which updates smoothly as the user moves the mouse over the SVG area.

AI-generated description

Use React to create an interactive circle that follows the mouse position.