At the end of the first time, go to the onFinish method, reset the time, and transfer different id and time. Debugging finds that the new data has been passed in, but there is no new time on the component for countdown, and the "00:00:00" is still displayed.
At the end of the first time, go to the onFinish method, reset the time, and transfer different id and time. Debugging finds that the new data has been passed in, but there is no new time on the component for countdown, and the "00:00:00" is still displayed.
constructor(props) { super(props); this.timeid = '1', this.state = { endtime: 3, }; } onFinish() { this.timeid = '2' this.setState({ endtime: 30, });
<CountDown id={this.timeid} size={12} until={this.state.endtime} onFinish={() => this.onFinish()}