Problem
- We wanted to
refetch some data inside useEffect
- Linting rule dictates that if we use
refetch inside of useEffect it has to be included in the dependency array.
- In each UI component re-render, we noticed that the
refetch function is redefined and retriggering the use-effect every time.
refetch function defined here, should be memoized.
Problem
refetchsome data insideuseEffectrefetchinside ofuseEffectit has to be included in the dependency array.refetchfunction is redefined and retriggering theuse-effectevery time.refetchfunction defined here, should be memoized.