Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set interval react

timer: function() {
   var newCount = this.state.currentCount - 1;
   if(newCount >= 0) { 
       this.setState({ currentCount: newCount });
   } else {
       clearInterval(this.state.intervalId);
   }
},
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #interval #react
ADD COMMENT
Topic
Name
9+9 =