Skip to content

Commit 3c42cb9

Browse files
committed
fix: just ignore inside the effect instead
1 parent 9935019 commit 3c42cb9

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/compass-context-menu/src/context-menu-provider.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,6 @@ export function ContextMenuProvider({
5656
[close]
5757
);
5858

59-
const handleContextMenuOpen = useCallback(
60-
(itemGroups: ContextMenuItemGroup[]) => {
61-
onContextMenuOpen?.(itemGroups);
62-
},
63-
// eslint-disable-next-line react-hooks/exhaustive-deps
64-
[]
65-
);
66-
6759
useEffect(() => {
6860
// Don't set up event listeners if we have a parent context
6961
if (parentContext || disabled) return;
@@ -77,7 +69,7 @@ export function ContextMenuProvider({
7769
return;
7870
}
7971

80-
handleContextMenuOpen(itemGroups);
72+
onContextMenuOpen?.(itemGroups);
8173

8274
setMenu({
8375
isOpen: true,
@@ -100,7 +92,8 @@ export function ContextMenuProvider({
10092
capture: true,
10193
});
10294
};
103-
}, [disabled, handleClosingEvent, handleContextMenuOpen, parentContext]);
95+
// eslint-disable-next-line react-hooks/exhaustive-deps
96+
}, [disabled, handleClosingEvent, parentContext]);
10497

10598
const value = useMemo(
10699
() => ({

0 commit comments

Comments
 (0)