fix: add handleCloseClick to useEffect dependency

This commit is contained in:
Fernando Zanutto 2024-04-23 19:25:47 -03:00
parent f3c362e3f3
commit 01c66d79af

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));