fix eslint

This commit is contained in:
Tom
2023-05-25 21:03:17 +02:00
parent 9c537b6286
commit bb54704a89
3 changed files with 11 additions and 10 deletions
+5 -4
View File
@@ -114,11 +114,12 @@ const Board = () => {
setOpenMenuCid(null);
};
const handleOutsideClick = (e) => {
const handleOutsideClick = useCallback((e) => {
if (openMenuCid !== null && !postMenuRef.current.contains(e.target) && !postMenuCatalogRef.current.contains(e.target)) {
setOpenMenuCid(null);
}
};
}, [openMenuCid, postMenuRef, postMenuCatalogRef]);
useEffect(() => {
if (openMenuCid !== null) {
@@ -130,7 +131,7 @@ const Board = () => {
return () => {
document.removeEventListener('click', handleOutsideClick);
};
}, [openMenuCid]);
}, [openMenuCid, handleOutsideClick]);
@@ -458,7 +459,7 @@ const Board = () => {
if (editedComment !== '') {
setTriggerPublishCommentEdit(true);
}
}, [editedComment]);
}, [editedComment, setIsAuthorEdit]);
useEffect(() => {