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
+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(() => {