I have an issue with setState().
Here is my routes.tsx file
export const Routes = (props:any) => (
<Router {...props}>
<Route path="/" component={Miramir}>
<Route path="/profile">
<IndexRoute component={Profile} />
<Route path="/profile/update" component={ProfileUpdate} />
</Route>
</Route>
So, when i trying to use /profile/update route
I have an warning and see that component which only for /profile route exists on /profile/update
This is an error
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the CountDown component.
Component CountDown
componentDidMount = () => {
let timeLeft = this.secondsToTime(this.state.date);
this.setState({time: timeLeft});
}
_countDown = () => {
this.setState({
time: this.secondsToTime(this.state.date)
})
}
Calling _countDown every sec
Hope your help!
Thanks