title: How to fix missing dependency warning when using useEffect React Hook
body: <p>With React 16.8.6 (it was good on previous version 16.8.3), I get this error when I attempt to prevent an infinite loop on a fetch request:</p>
  <pre><code>./src/components/BusinessesList.js
  Line 51:  React Hook useEffect has a missing dependency: 'fetchBusinesses'.
  Either include it or remove the dependency array  react-hooks/exhaustive-deps
  </code></pre>
  <p>I've been unable to find a solution that stops the infinite loop. I want to stay away from using <code>useReducer()</code>.  I did find this discussion <em><a href="https://github.com/facebook/react/issues/14920" rel="noreferrer">[ESLint] Feedback for 'exhaustive-deps' lint rule #14920</a></em> where a possible solution is <code>You can always // eslint-disable-next-line react-hooks/exhaustive-deps if you think you know what you're doing.</code> I'm not confident in what I'm doing, so I haven't tried implementing it just yet.</p>
  <p>I have this current setup, <em><a href="https://stackoverflow.com/questions/53243203/react-hook-useeffect-runs-continuously-forever-infinite-loop">React hook useEffect runs continuously forever/infinite loop</a></em> and the only comment is about <code>useCallback()</code> which I'm not familiar with.</p>
  <p>How I'm currently using <code>useEffect()</code> (which I only want to run once in the beginning similar to <code>componentDidMount()</code>):</p>
  <pre><code>useEffect(() =&gt; {
      fetchBusinesses();
    }, []);
  </code></pre>
  <pre><code>const fetchBusinesses = () =&gt; {
      return fetch(&quot;theURL&quot;, {method: &quot;GET&quot;}
      )
        .then(res =&gt; normalizeResponseErrors(res))
        .then(res =&gt; {
          return res.json();
        })
        .then(rcvdBusinesses =&gt; {
          // some stuff
        })
        .catch(err =&gt; {
          // some error handling
        });
    };
  </code></pre>