Skip to content

IFDM-332: lint error fix - #173

Open
jenbreese wants to merge 1 commit into
devfrom
IFDM-332
Open

IFDM-332: lint error fix#173
jenbreese wants to merge 1 commit into
devfrom
IFDM-332

Conversation

@jenbreese

Copy link
Copy Markdown
Collaborator

READY FOR REVIEW

Fix: Remove unnecessary dependency from useMemo in interest calculator

Description

Removed the unused mode dependency from the useMemo hook in the interest calculator that was triggering an ESLint react-hooks/exhaustive-deps warning.

Why

The mode variable (saving vs. borrowing) only affects the surrounding UI copy and colors, not the actual interest calculation. Including it in the dependency array causes unnecessary re-memoization when the mode changes.

The code's own comment confirms this:

"mode only affects the surrounding copy and colors, not the numbers."

Changes

  • File: app/interactives/interest-calculator/page.tsx
  • Line 175: Updated dependency array from [debounced, hasError, mode] to [debounced, hasError]

Testing

  • Ran yarn lint — all checks pass ✅
  • No functional changes to the calculation logic
  • UI behavior remains the same

Related

Resolves ESLint warning: react-hooks/exhaustive-deps

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