Skip to content

Commit fc8cd47

Browse files
committed
fix: just ignore inside the effect instead
1 parent b4a4543 commit fc8cd47

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
@@ -57,14 +57,6 @@ export function ContextMenuProvider({
5757
[close]
5858
);
5959

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

81-
handleContextMenuOpen(itemGroups);
73+
onContextMenuOpen?.(itemGroups);
8274

8375
setMenu({
8476
isOpen: true,
@@ -110,7 +102,8 @@ export function ContextMenuProvider({
110102
capture: true,
111103
});
112104
};
113-
}, [disabled, handleClosingEvent, handleContextMenuOpen, parentContext]);
105+
// eslint-disable-next-line react-hooks/exhaustive-deps
106+
}, [disabled, handleClosingEvent, parentContext]);
114107

115108
const value = useMemo(
116109
() => ({

0 commit comments

Comments
 (0)