talalmajali / react-native-countdown-component

React Native CountDown
MIT License
266 stars 233 forks source link

The countdown is not working #73

Open gponsu opened 4 years ago

gponsu commented 4 years ago

I think this change has broken the countdown: https://github.com/talalmajali/react-native-countdown-component/commit/28f059478f6ae9479677a3cc5b42334b73a2cc09

thedavidpeterson commented 4 years ago

What issue are you having?

sekizlipenguen commented 4 years ago

Hi, That is not working when, I call it second time in a page. I have been realize that issue came from the below update

componentDidUpdate(prevProps, prevState) { if (this.props.until !== nextProps.until || this.props.id !== nextProps.id) { if (this.props.until !== prevProps.until || this.props.id !== prevProps.id) { this.setState({ this.setState({ lastUntil: this.state.until, lastUntil: prevState.until, until: Math.max(nextProps.until, 0) until: Math.max(prevProps.until, 0) }); }); } } } }

workaround;

Screen Shot 2020-05-21 at 11 27 00