()
| 1 | import { useEffect, useState } from "react" |
| 2 | |
| 3 | export const Message = () => { |
| 4 | |
| 5 | const [coords, setCoords] = useState({ x: 0, y: 0}); |
| 6 | |
| 7 | useEffect(() => { |
| 8 | |
| 9 | const onMouseMove = ({ x, y }) => { |
| 10 | // const coords = { x, y }; |
| 11 | setCoords({ x, y }) |
| 12 | } |
| 13 | |
| 14 | window.addEventListener( 'mousemove', onMouseMove ); |
| 15 | |
| 16 | return () => { |
| 17 | window.removeEventListener( 'mousemove', onMouseMove ); |
| 18 | } |
| 19 | }, []); |
| 20 | |
| 21 | |
| 22 | |
| 23 | return ( |
| 24 | <> |
| 25 | <h3>Usuario ya existe</h3> |
| 26 | { JSON.stringify( coords ) } |
| 27 | </> |
| 28 | ) |
| 29 | } |
nothing calls this directly
no outgoing calls
no test coverage detected