We're introducing a new ESLint rule called react-hooks/exhaustive-deps
this
week. The rule is a great guide for handling dependencies in React Hooks
and guard against lying about them.
It will help us catch potential, hard to debug, bugs and to use React Hooks in their intended way.
The dependency array is a way to synchronize data and should not be viewed as a sort of life-cycle handler.