title: React hooks state is not updated right after it's set with async
body: <p>Is it not possible to get the updated hook value right after setting it? I assume react only updates value for the next render, since my screen following async-await renders fine. Just logs are not printing out the state I was expecting.</p>
  
  <p>Not sure if I'm suppose to log state like this, or write another useEffect just for the states I need and put console.log in there instead?</p>
  
  <pre><code>const [uid, setUID] = useState&lt;string | undefined&gt;(undefined);
  const [state, setState] = useState&lt;{ [key: string]: any; } | undefined&gt;();
  
  const load = async () =&gt; {
    const currentUID = auth().currentUser?.uid;
    setUID(currentUID);
  
    console.log(uid); // returns undefined
    console.log(currentUID); // this prints fine
  
    await firestore().collection('users').doc(currentUID).get().then(docSnapshot =&gt; {
      setState(docSnapshot.data());
      console.log('Profile: loaded', state); // returns undefined
    });
  
    console.log(uid); // returns undefined even after await
    console.log('Profile: loaded', state); // returns undefined even after await
  }
  
  useEffect(() =&gt; { 
    load();
  }, []);
  </code></pre>