I am trying to bind a mouse move event to the thing. But what ever I do, either e is empty or e.clientX and Y is null.
const App = (props) => {
const [move, setMove] = useState({"ix": 0, "iy": 0});
const handleMove = (e) => {
console.log(e);
}
return (
<div onMouseMove={handleMove} width="500" height="500"></div> //e exists but clientX is null
<div onMouseMove={() => handleMove()} width="500" height="500"></div> //e undefined
);
}
console log:
{…}
_dispatchInstances: null
_dispatchListeners: null
_targetInst: null
altKey:
bubbles:
button:
buttons:
cancelable:
clientX: null
clientY: null
additionally I am flooded with this warning, which I don't understand even after reading the provided link
Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the property
pageYon a released/nullified synthetic event. This is set to null. If you must keep the original synthetic event around, use event.persist(). See https://fb me/react-event-pooling for more information.