How to correctly specify dependencies for useEffect?
Answer
•List all values used inside the effect.
•Do not disable eslint rules without reason.
•Use useCallback for functions.
•Use useMemo for objects.
•If the effect is too 'noisy' — reconsider the architecture.
Was this answer helpful?