{
console.log('inside', seconds)
if (seconds === 0) {
clearInterval(intervalId)
setDisable(true)
} else {
setSeconds((count) => count - 1)
}
}, 1000)
Its not checking for the if condition and the counter is infinitely decrementing. What could be wrong?
I read that with hooks we must use useInterval hook but its a hook and I cannot call it inside a function like I want to.
Обсуждают сегодня