From 25a3cf0fcec8c42ce55f4a33d6d2d5bd08f49826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 31 Mar 2025 22:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BAContextMenu=E7=9A=84=E6=89=93=E5=BC=80?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86=E5=A2=9E=E5=8A=A0Memo?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ContextMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsx index 198db8c..61fc499 100644 --- a/src/components/ContextMenu.tsx +++ b/src/components/ContextMenu.tsx @@ -285,7 +285,7 @@ const ContextMenu: FC = ({ color }) => { const triggerRef = useRef(null); const menuRef = useRef(null); - const handleOpenMenu = () => { + const handleOpenMenu = useCallback(() => { if (isOpen) { setIsOpen(false); return; @@ -301,7 +301,7 @@ const ContextMenu: FC = ({ color }) => { setRenderPosition({ x, y }); setIsOpen(true); } - }; + }, [isOpen]); const handleCloseMenu = useCallback(() => { setIsOpen(false); }, []);