New: Intelligent Flashcards spaced-repetition decks for every topic, built to make things actually stick.
You call setCount(count + 1) and then read count on the very next line of the same handler. What value do you get?
setCount(count + 1)
count
Always undefined until the next paint
The old value, since state stays constant for the whole current render
The new value, because calling the setter immediately overwrites the count variable in place