We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-practice/basic_stop_watch/src/StopWatch.js
Line 33 in 67df773
The text was updated successfully, but these errors were encountered:
我也发现这个问题了,每次停止后在开始都是重新计算
Sorry, something went wrong.
onStart = () => { if (this.state.startTime && this.state.currentTime) { this.setState({ isStarted: true, }); } else { this.setState({ isStarted: true, startTime: new Date(), currentTime: new Date(), }); } this.intervalHandle = setInterval(() => { this.setState({ currentTime: new Date() }); }, 1000 / 60); };
onStart 改造一下,可以解决这个问题。
No branches or pull requests
react-practice/basic_stop_watch/src/StopWatch.js
Line 33 in 67df773
The text was updated successfully, but these errors were encountered: