Comments (9)
@jamesbvaughan, thanks for reporting this! Will take a look at it in a few days and reply back.
from react.
@hoxyq I can try to put together a PR this week.
from react.
I've put put a PR: #28399
from react.
@hoxyq Could you advise when the DevTools Firefox Extension will be updated? This issue affects me and it's good to see that it's been fixed but my browser is stuck on v5.0.0 of the extension from December.
I've uploaded v5.0.2 to Firefox store a week ago, its still pending review process.
from react.
I've made a bit more progress investigating this.
I believe the cause might be the two calls to nextHook
in useSyncExternalStore
:
react/packages/react-debug-tools/src/ReactDebugHooks.js
Lines 265 to 274 in 1d5667a
To try to verify that, I found that just one other hook in that file, useTransition
, also makes two calls to nextHook
:
react/packages/react-debug-tools/src/ReactDebugHooks.js
Lines 284 to 292 in 1d5667a
I modified my test case to use useTransition
rather than useSyncExternalStore
and confirmed that it also causes hook parsing to fail.
from react.
hey @hoxyq did you work on this?
from react.
react/packages/react-debug-tools/src/ReactDebugHooks.js
Lines 56 to 82 in 1d5667a
When i was trying to debug this problem i notice that here they didn't call the useSyncExternalStore
and useTransition
from Dispatcher
so I add the line Dispatcher.useSyncExternalStore(() => {}, () => {}, () => {})
above the line Dispatcher.useMemo(() => null)
in above source code, and it worked fine. I don't know if this was intentionally or it a mistake.
from react.
react/packages/react-debug-tools/src/ReactDebugHooks.js
Lines 56 to 82 in 1d5667a
When i was trying to debug this problem i notice that here they didn't call the
useSyncExternalStore
anduseTransition
fromDispatcher
so I add the lineDispatcher.useSyncExternalStore(() => {}, () => {}, () => {})
above the lineDispatcher.useMemo(() => null)
in above source code, and it worked fine. I don't know if this was intentionally or it a mistake.
Sorry for a late reply. Yes, this is required for generating stack frames of primitives, so this could be the root cause of why RDT can't find useSyncExternalStore
hook.
@jamesbvaughan Thanks for providing the repro! Is someone interested in testing this solution against the repro and opening a PR?
from react.
@hoxyq Could you advise when the DevTools Firefox Extension will be updated? This issue affects me and it's good to see that it's been fixed but my browser is stuck on v5.0.0 of the extension from December.
from react.
Related Issues (20)
- Question and suggest: The official identifier of Server Compnoent and Client Component HOT 3
- Bug: when installing the application, the old version of "react-scripts" is installed HOT 1
- Bug: Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string. HOT 4
- Bug: optimistic state (useOptimistic) shows both optimistic and returned from server data when running several async actions HOT 6
- [DevTools Bug]: React Profiler reports higher hook numbers than shown in Components HOT 2
- about the react performance (how to improve it) HOT 3
- Bug: use() hook HOT 4
- Bug: Flight (RSC) examples are not accessible HOT 1
- useMemo reruns when the dependencies not changed when memoised value is a fn HOT 3
- Bug: [Flight] Async server components in `ai/rsc` not rendered correctly HOT 1
- Bug: React Dev tools extension showing wrong source file path on inspection HOT 4
- Bug: Using the hook useDeferredValue - Suspense fallback didn't show the contents HOT 4
- Bug: react-intl formatMessage cannot format message with param that neat by Single quotation mark HOT 3
- custom use directives + using closure serializer
- In react fiber, is didReceiveUpdate related to dirty checking?
- Naming convention HOT 1
- Bug: Rapid click fails to catch the onClick event properly
- Bug: script element not suspending in canary
- Bug: [PPR] Resume failed when "moduleLoading === undefined" in function prepareDestinationWithChunks
- Bug: Expected a suspended thenable. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.