3

In this screenshot we can see two warnings from react-hooks/exhaustive-deps:

enter image description here

  1. React Hook useCallback has an unnecessary dependency: 'b'. Either exclude it or remove the dependency array.

  2. React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead.

However L14 useCallback(noop, [c]) doesn't use its c dependency nor is an inline function yet the linter has issued no warnings whatsoever. Why?

customcommander
  • 17,580
  • 5
  • 58
  • 84

0 Answers0