diff --git a/components/ui/Modal/Modal.tsx b/components/ui/Modal/Modal.tsx index c3b0c8df2..300a99192 100644 --- a/components/ui/Modal/Modal.tsx +++ b/components/ui/Modal/Modal.tsx @@ -19,12 +19,14 @@ interface Props { const Modal: FC = ({ children, open, onClose, onEnter = null }) => { const ref = useRef() as React.MutableRefObject - const handleKey = (e: KeyboardEvent) => - useCallback(() => { + const handleKey = useCallback( + (e: KeyboardEvent) => { if (e.key === 'Escape') { return onClose() } - }, [onClose]) + }, + [onClose] + ) useEffect(() => { if (ref.current) {