title: React / Axios send infinite number of requests
body: <p>I'm fetching data from my backend api when component mount and can do it successfuly but my React app keeps sending requests to the server causing it to slow down. I used useEffect hook, but I'm getting the same result without using the hook.</p>
  
  <pre><code>useEffect(() =&gt; {
     axios.get('http://127.0.0.1:8000/food_category/')
    .then(response =&gt; {
     setFoodCategory(response.data);
     console.log(response.data);
  })});
  </code></pre>
  
  <p>What am I doing wrong?</p>