Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react function being called every minute

componentDidMount() {
  this.interval = setInterval(() => this.setState({ time: Date.now() }), 1000);
}
componentWillUnmount() {
  clearInterval(this.interval);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #function #called #minute
ADD COMMENT
Topic
Name
9+3 =