title: React error for useEffect Hook conditional call when there is no such conditional call
body: <p>React is complaining about code below, saying it <code>useEffect</code> is being called conditionally:</p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { useEffect } from "react";
  import ReactDOM from "react-dom";
  
  function App() {
    const documentCounts = {};
    const invertedIndexes = {};
  
    for (const term of []) {
      if (!invertedIndexes[term]) continue;
      // The offending code is the loop below
      for (const arr of invertedIndexes[term]) {
        const documentIndex = arr[0];
        if (!documentCounts[documentIndex]) documentCounts[documentIndex] = 1;
        else ++documentCounts[documentIndex];
      }
    }
  
    useEffect(() =&gt; {});
  
    return (
      &lt;div className="App"&gt;
        &lt;h1&gt;Hello World&lt;/h1&gt;
      &lt;/div&gt;
    );
  }
  
  const rootElement = document.getElementById("root");
  ReactDOM.render(&lt;App /&gt;, rootElement);
  
  </code></pre>
  
  <pre><code>React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks
  </code></pre>
  
  <p>But to me it seems like there is no conditional call to <code>useEffect</code> - the loop just modifies local variables. Does anyone happen to know what the problem here is?</p>
  
  <p>(the pointless variables are what I boiled down my original code down to to try to pinpoint the issue)</p>
  
  <p>Sandbox:
  <a href="https://codesandbox.io/s/friendly-diffie-z7edc" rel="nofollow noreferrer">https://codesandbox.io/s/friendly-diffie-z7edc</a></p>