Skip to content

fix: add missing useCallback dependency arrays in App.tsx#140

Open
kuishou68 wants to merge 1 commit intosnarktank:mainfrom
kuishou68:fix/issue-139-usecallback-deps
Open

fix: add missing useCallback dependency arrays in App.tsx#140
kuishou68 wants to merge 1 commit intosnarktank:mainfrom
kuishou68:fix/issue-139-usecallback-deps

Conversation

@kuishou68
Copy link
Copy Markdown

Closes #139\n\n## Problem\n\ngetNodes and getEdgeVisibility are used inside handleNext, handlePrev, and handleReset useCallback hooks but are not listed in their dependency arrays. This causes stale closure bugs and triggers react-hooks/exhaustive-deps ESLint violations.\n\n## Fix\n\nWrapped getNodes and getEdgeVisibility in useCallback with stable [] dependency arrays, then added them to the dependency arrays of the three affected handlers.

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.

bug: useCallback missing deps in App.tsx cause stale closure and ESLint failure

1 participant