title: How to fix React Redux and React Hook useEffect has a missing dependency: 'dispatch'
body: <blockquote>
    <p>React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps</p>
  </blockquote>
  
  <p>I use <code>useDispatch()</code> Hook from React Redux on a functional component like this: </p>
  
  <pre><code>const Component = () =&gt; {
    const dispatch = useDispatch();
    const userName = useSelect(state =&gt; state.user.name);
  
    useEffect(() =&gt; {
      dispatch(getUserInformation());
    }, [userId]);
  
    return (
      &lt;div&gt;Hello {userName}&lt;/div&gt;
    );
  };
  
  export default Component;
  </code></pre>
  
  <p>How to remove this warning without removing the dependency array react-hooks/exhaustive-deps which can be useful to avoid other errors. </p>