Build a countdown timer. Pressing the start button counts down from 10 by 1 every second and stops at 0. Complete Countdown.
Build a React countdown timer. Pressing the start button counts down from 10 by 1 every second and stops at 0. Before starting, 10 is shown, and the starting value is fixed at 10. It all lives in a single component.
A timer is a screen whose value changes on its own as time passes, then stops at a set condition — here, 0. Such a screen has to be handled across its whole lifecycle: start, then run, then stop. In React you hold the value that changes over time in state and re-render the view each time it changes. What makes the behavior trustworthy is verifying not just a single tick but the whole flow from start until it stops at 0.