fix: add handleCloseClick to useEffect dependency

This commit is contained in:
Fernando Zanutto 2024-04-23 19:25:47 -03:00
parent 376c0810cd
commit 08fbaf7b59

View File

@ -57,7 +57,7 @@ export function Modal({
window.addEventListener("keydown", onKeyDown);
return () => window.removeEventListener("keydown", onKeyDown);
}, []);
}, [handleCloseClick]);
useEffect(() => {
const onMouseDown = (e: MouseEvent) => {
@ -74,7 +74,7 @@ export function Modal({
window.addEventListener("mousedown", onMouseDown);
return () => window.removeEventListener("mousedown", onMouseDown);
}, []);
}, [handleCloseClick]);
useEffect(() => {
dispatch(toggleDragging(visible));