The lint rules force me to include 'dispatch' also as a dependency for useEffect().
(If I don't add dispatch as dependency, it throws warning that "React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array.")
Is it okay to list dispatch or any other function as dependency? Is there a better way to use without disabling the lint rule?
useEffect(() => {
if (debouncedSearchText) {
dispatch(getUsers(pageIndex, rows, debouncedSearchText));
}
},[debouncedSearchText, pageIndex, dispatch]);