-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Description
Prior Issues
No prior issue in this repository, but it's probably related with facebook/react#19114 (comment) .
What is the current behavior?
When using hooks that depend on useSyncedRef
, like useTimeoutEffect
, state updates will stop working if React Developer Tools is open.
Steps to Reproduce
https://codesandbox.io/s/billowing-rain-lwrjqd?file=/src/App.js:50-61
- Open the sandbox link above.
- Click "Open in New Window" button on the top-right corner of the preview section.
- Once the page loads, "false" should be displayed, and after 1 second, it changes to "true". This is expected.
- Open your browser's developer tool (Firefox or Chrome), switch to Components tab in React Developer Tools. (If you haven't installed React Developer Tools yet, it can be found here: https://github.com/facebook/react/blob/main/packages/react-devtools-extensions/README.md)
- Click to focus on the only component,
App
. - Refresh the page. This time "false" is displayed, and it never changes to "true".
What is the expected behavior?
useTimeoutEffect
should work regardless of whether React Developer Tools is open or not.
Environment Details
@react-hookz/web
version: 23.0.0react
version: 18.2.0react-dom
version: 18.2.0typescript
version: N/A (using JavaScript in the code sandbox above)- OS: macOS
- Browser: Firefox 114.0.2
- Did this work in previous versions? I don't think so. The
useTimeoutFn
in react-use does work though.
alexrififi
Metadata
Metadata
Assignees
Labels
No labels