mercredi 25 août 2021

Using useState with an if conditional inside of setInterval isn't working

Example code

Desired outcome: Go to 100, counting by 10 every 1 second. Once you reach over 100, turn off the timer.

Actual outcome: It just keeps going up and up, faster than 10 every 1 second.

Aucun commentaire:

Enregistrer un commentaire