-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Code Rabbit pointed out the following verified issue
Remove triggerRef.current from the deps array.
Including triggerRef.current in the dependency array violates React rules. Ref mutations don't trigger re-renders, and the .current property should not be tracked in dependency arrays. This can lead to stale closures or unexpected behavior.
Apply this diff to fix the issue:
const rootRef = useAugmentedRef({
ref: ref as React.Ref<ContextMenuMethods>,
methods: {
presentMenu: () => {
triggerRef.current?.open();
},
dismissMenu,
},
-
deps: [triggerRef.current],
-
});
deps: [],
@src/components/nativewindui/ContextMenu/ContextMenu.tsx
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog