title: React Hook useEffect has a missing dependency: 'list'
body: <p>Once I run the below code, I get the following error:</p>
  
  <blockquote>
    <p>React Hook useEffect has a missing dependency: 'list'. Either include it or remove the dependency array  react-hooks/exhaustive-deps</p>
  </blockquote>
  
  <p>I cannot find the reason for the warning.</p>
  
  <pre><code>import React, { useState, useEffect } from 'react';
  import axios from 'axios';
  import Form from './Form';
  
  const App = () =&gt; {
    const [term, setTerm] = useState('pizza');
    const [list, setList] = useState([]);
  
    const submitSearch = e =&gt; {
      e.preventDefault();
      setTerm(e.target.elements.receiptName.value);
    };
  
    useEffect(() =&gt; {
      (async term =&gt; {
        const api_url = 'https://www.food2fork.com/api';
        const api_key = '&lt;MY API KEY&gt;';
  
        const response = await axios.get(
          `${api_url}/search?key=${api_key}&amp;q=${term}&amp;count=5`
        );
  
        setList(response.data.recipes);
        console.log(list);
      })(term);
    }, [term]);
  
    return (
      &lt;div className="App"&gt;
        &lt;header className="App-header"&gt;
          &lt;h1 className="App-title"&gt;Recipe Search&lt;/h1&gt;
        &lt;/header&gt;
        &lt;Form submitSearch={submitSearch} /&gt;
        {term}
      &lt;/div&gt;
    );
  };
  
  export default App;
  </code></pre>