You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In "A stopwatch" example for useRef an interval is set in handleStart(). It is cleared in handleStop(). But if the component is unmounted after the interval is started, but without stopping it, it is never cleared, which means setNow can get called on an unmounted component.
Summary
In "A stopwatch" example for useRef an interval is set in
handleStart()
. It is cleared inhandleStop()
. But if the component is unmounted after the interval is started, but without stopping it, it is never cleared, which meanssetNow
can get called on an unmounted component.Page
https://react.dev/reference/react/useRef#examples-value
Details
No response
The text was updated successfully, but these errors were encountered: