Symptom
The workout timer starts counting normally, but after stopping and starting it a few times, the seconds increment faster and faster. Instead of ticking once per second, it ticks 2x, 3x, or more times per second.
Expected
The timer should always tick exactly once per second regardless of how many times it is started and stopped.
What you know
The useTimer hook creates a setInterval when isRunning becomes true. The interval should increment the seconds counter once per second. Something is causing multiple intervals to run simultaneously.
Hints
TypeScript
TypeScript ready
Test Output
▶
Click "Run Tests" to execute your code