Skip to content

Conversation

@CodeWithBehnam
Copy link
Owner

Summary

  • Fix useClipboard hook dependency issue using propsRef pattern to avoid stale closures
  • Wrap shortcuts array in useMemo to prevent useEffect re-registration on every render
  • Add eslint-disable comments for react-refresh/only-export-components where hooks/utilities are exported alongside components (standard React pattern)

Changes

File Fix
useClipboard.ts Converted handlers to useCallback with propsRef pattern
useKeyboardShortcuts.ts Wrapped shortcuts array in useMemo
Context providers eslint-disable for exported hooks
Components eslint-disable for exported utilities

Test plan

  • bun run lint passes with 0 warnings
  • bun run typecheck passes
  • Keyboard shortcuts still work (undo/redo, save, etc.)
  • Clipboard paste still works

Behnam Ebrahimi

- Fix useClipboard hook dependency issue using propsRef pattern
- Wrap shortcuts array in useMemo to prevent useEffect re-registration
- Add eslint-disable for react-refresh/only-export-components where
  hooks/utilities are exported alongside components (standard pattern)

Affected files:
- useClipboard.ts: converted to useCallback with propsRef
- useKeyboardShortcuts.ts: wrapped shortcuts in useMemo
- Context providers: GraphContext, ExecutionContext, ImageHistoryContext
- Components: ContextMenu, ImageModal, SettingsDialog

Co-Authored-By: Behnam & Claude Code
@CodeWithBehnam CodeWithBehnam merged commit 050feb8 into main Dec 25, 2025
2 checks passed
@CodeWithBehnam CodeWithBehnam deleted the fix/eslint-warnings branch December 25, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants