Browse Source
* small fixes to stopwatch codesandbox noticed that the explanation for the first stopwatch codesandbox mentions "update the time every 10 milliseconds" so updated the codesandbox to reflect that also there's a small nuanced bug in the second stopwatch codesandbox where each call to `handleStart()` sets a new interval without checking if there's already one ongoing. Ie: If the user accidentally double clicks the start button, they set two intervals for updating `now` every 10ms and then intervalRef only retains the second interval ID. Thus, it's impossible to actually stop the timer because `handleStop()` will only clear the latest set interval while the original one will keep executing. * Update referencing-values-with-refs.md * Update referencing-values-with-refs.md * Update referencing-values-with-refs.md Co-authored-by: dan <dan.abramov@gmail.com>main
Aayush Kumar
3 years ago
committed by
GitHub
1 changed files with 4 additions and 2 deletions
Loading…
Reference in new issue