Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 793 Bytes

useCallback.md

File metadata and controls

13 lines (8 loc) · 793 Bytes

useCallback

Removing dependencies: functions

Heuristic to keep the dependency array small: To remove functions from the dependency array try the following steps (in order):

  1. Function into useEffect hook
  2. Function out of component
  3. Function with useCallback (see this CodeSandBox of our code (JS) for an example)