useEffect(() => {
if(timeRemaining > 0) {
setTimeout(() => {
setTimeRemaining(time => time - 1)
}, 1000)
}
}, [timeRemaining])
useEffect(() => {
if(timeRemaining > 0) {
setTimeout(() => {
setTimeRemaining(time => time - 1)
}, 1000)
}
}, [timeRemaining])