Answer the question
In order to leave comments, you need to log in
How to make a timer in React Native?
Hello!
I tried to make a timer through setInterval and this.setState , but with this approach, the entire application stopped and behaved somehow inappropriately.
Here is an excerpt of my NOT working code:
timer() {
let timer = setInterval(() => {
this.setState({
seconds: this.state.seconds + 1
})
}, 1000)
}
render() {
return(
{this.timer()}
<Text>{this.state.seconds}</Text>
)}
Answer the question
In order to leave comments, you need to log in
https://nabendu.blog/posts/simple-timer-app-with-r...
this is not a bad example , I
just chewed it up a lot
, take a look here https://stackoverflow.com/questions/31963803/creat...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question