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(() => {
+3 -3
View File
@@ -103,11 +103,11 @@ const Catalog = () => {
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) {
@@ -119,7 +119,7 @@ const Catalog = () => {
return () => {
document.removeEventListener('click', handleOutsideClick);
};
}, [openMenuCid]);
}, [openMenuCid, handleOutsideClick]);
+3 -3
View File
@@ -116,11 +116,11 @@ const Thread = () => {
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) {
@@ -132,7 +132,7 @@ const Thread = () => {
return () => {
document.removeEventListener('click', handleOutsideClick);
};
}, [openMenuCid]);
}, [openMenuCid, handleOutsideClick]);
useEffect(() => {