I want to show the current time(MM/DD/YY hh:mm:ss) in react native app like a clock, and get update every seconds, I tried using new Date() and set it in state, but the time don
Just move setInterval into componentDidMount function.
setInterval
Like this :
componentDidMount() { setInterval(() => { this.setState({ curTime : new Date().toLocaleString() }) }, 1000) }
This will change state and update every 1s.