Part of Andrei Neagoie's course on Udemy: https://www.udemy.com/course/complete-react-developer-zero-to-mastery/ .
I embarassingly did not know that setState()
was asynchronous until this part in the course. Prior to this, I'd had plenty of state-related React code not work the way I expected it to, and I had to implement weird workarounds as a result.