forked from arayabrain/barebone-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
The problem: handleClickVariant is recreated on every render (line 360), causing the useCallback at line 622 to have
unstable dependencies. This triggers unnecessary re-renders and defeats the purpose of useCallback.
Impact: Causes child components to re-render unnecessarily, affecting performance.
Fix: Wrap handleClickVariant in its own useCallback with enqueueSnackbar as a dependency.
[eslint]
src/pages/AccountManager/index.tsx
Line 360:9: The 'handleClickVariant' function makes the dependencies of useCallback Hook (at line 622) change on every render. To fix this, wrap the definition of 'handleClickVariant' in its own useCallback() Hook react-hooks/exhaustive-deps
Metadata
Metadata
Assignees
Labels
No labels