Create a class component <Timer /> that you’ll display in <App/> In the constructor add a date to the state this.state = { date: new Date() }; In componentDidMount create a setInterval that updates the date every second (using setState()) code example
Example: react function being called every minute
componentDidMount() {
this.interval = setInterval(() => this.setState({ time: Date.now() }), 1000);
}
componentWillUnmount() {
clearInterval(this.interval);
}