/* eslint-disable react-hooks/exhaustive-deps */ import { useEffect } from "react"; export function useEvent(element: Node, eventName: string, listener: (e: any) => any, deps: any[] = []) { useEffect(() => { element.addEventListener(eventName, listener); return () => element.removeEventListener(eventName, listener); }, deps); };
782000cookie-checkReact Hook useEvent