Code Rabbit pointed out the following verified issue
⚠️ Potential issue | 🟠 Major
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],
@src/components/nativewindui/ContextMenu/ContextMenu.tsx
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:
@src/components/nativewindui/ContextMenu/ContextMenu.tsx