update state after 10 seconds from initial time reactjs code example
Example: react function being called every minute
componentDidMount() {
this.interval = setInterval(() => this.setState({ time: Date.now() }), 1000);
}
componentWillUnmount() {
clearInterval(this.interval);
}