0

enter image description here

enter image description here

Thank you for your help.

I expected that when I click the button(red circle), the showPopUp in handleClick runs, and here the "popup" should be true, but it wasn't. I thought, the showPopUp(setState) is async and the console.log run first.

What's the actual matter was and How can I use the useState function synchronously like Promise function?

djangoboi
  • 28
  • 4

0 Answers0