A countdown timer has hours, minutes and seconds that count down to 0 when started. In this problem, you are required to create a Countdown component that takes in an input of minutes, that when started, counts down to zero and prints the countdown on the screen.
input
as the minutes
that you want the countdown to start from.Reset
button to reset the timer.Pause
button to pause the timer.Click to reveal
You can use useRef
and useState
to derive the solution
Click to reveal
Try using setInterval()
to count down and decrement the counter every time.