title: Does React batch state update functions when using hooks?
body: <p>For class components, <code>this.setState</code> calls batch if inside event handlers. But what happens if state is updated outside the event handler and using <code>useState</code> hook?</p>
  
  <pre><code>function Component() {
    const [a, setA] = useState('a');
    const [b, setB] = useState('b');
  
    function handleClick() {
      Promise.resolve().then(() =&gt; {
        setA('aa');
        setB('bb');
      });
    }
  
    return &lt;button onClick={handleClick}&gt;{a}-{b}&lt;/button&gt;
  }
  </code></pre>
  
  <p>Will it render <code>aa - bb</code> right away? Or it will be <code>aa - b</code> and then <code>aa - bb</code>?</p>