title: The order of react hooks
body: <p>I am trying to understand how <code>React hooks</code> work reading official docs:</p>
  <p><a href="https://reactjs.org/docs/hooks-rules.html" rel="nofollow noreferrer">https://reactjs.org/docs/hooks-rules.html</a></p>
  <p>And there they say that react relies on the order hooks are called. I still don't get why the order is of importance and why a hook placed in a conditional will cause bugs, could anyone explain?</p>
  <p>Particularly this sentence makes me confused:</p>
  <blockquote>
  <p>React wouldn’t know what to return for the second useState Hook call</p>
  </blockquote>
  <p>why?? Does <code>react</code> somehow binds <code>useState</code> with <code>useEffect</code>?</p>
  <p>Then, this question:</p>
  <blockquote>
  <p>So how does React know which state corresponds to which useState call?</p>
  </blockquote>
  <p>From my understanding there is only one state, so why they are talking about state<strong>s</strong> (plural)?</p>