Hook import { useState, useEffect } from "react"; const useMousePosition = () => { const [mousePosition, setMousePosition] = useState({ x: null, y: null }); const updateMousePosition = ev => { setMousePosition({ x: ev.clientX, y: ev.clientY });