title: React: can i use async in an onChange event function?
body: <p>is it possible to use async to wait for a function to complete inside a onChange event.
  Example:</p>
  <pre><code>const onChange = async (e) =&gt; {
     
        console.log(current[e.target.name]);   
        await setCurrent({ ...current, [e.target.name]: e.target.value });
        console.log(current[e.target.name]);
  }
  </code></pre>
  <p>the second <code>console.log</code> is giving the same value since it is not waiting for the <code>setCurrent</code> to finish. Is there a way to make it wait for that?
  Thank you</p>