title: Unable to set useState variable in async method and console log it
body: <p>Im working with my friends on a app project and we find an issue many times when we tring to set a use state and the console log the variable, i've looking for a solution in the website and saw that the reason is that the usestate is an async awiat which means the variable that i set in the use state isn't immidatly set in it, so i tried many solution that i found in the websites but none of them work for me.
  in the screenShot you can see that the json variable is in console log before and the set varaible doesn't show after the setActiveUser , any help?</p>
  <p>Thanks!</p>
  <p><a href="https://i.stack.imgur.com/MHWZ1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MHWZ1.png" alt="My ScreenShot" /></a></p>