title: How to fix this "React Hook useEffect has a missing dependency" warning?
body: <p>Here's my file:</p>
  
  <pre><code>// useFetcher.js
  import { useEffect, useState } from "react";
  
  export default function useFetcher(action) {
    const [loading, setLoading] = useState(false);
    const [error, setError] = useState(null);
    const [data, setData] = useState(null);
    async function loadData() {
      try {
        setLoading(true);
        const actionData = await action();
        setData(actionData);
      } catch (e) {
        setError(e);
      } finally {
        setLoading(false);
      }
    }
    useEffect(() =&gt; {
      loadData();
    }, [action]);
    return [data, loading, error];
  }
  </code></pre>
  
  <p>On line 21, eslint complaints that:</p>
  
  <pre><code>React Hook useEffect has a missing dependency: 'loadData'. Either include it or remove the dependency array.eslint(react-hooks/exhaustive-deps)
  </code></pre>
  
  <p>How can I fix this?</p>