Skip to content

[DevTools Bug]: Hook parsing fails if a hook uses useSyncExternalStore #27889

@jamesbvaughan

Description

@jamesbvaughan

Website or app

https://react-devtools-issue-demo.vercel.app/

Repro steps

  1. Open up this page: https://react-devtools-issue-demo.vercel.app/ (source: https://github.com/jamesbvaughan/react-devtools-issue-demo/blob/main/src/App.tsx)
  2. Open up the React dev tools
  3. Navigate to the Components tab
  4. Observe in the right sidebar that hook name parsing fails for one of the two components.

Hook name parsing is really helpful when debugging/optimizing large components with lots of hooks, and this issue makes that feature unusable on components whose hooks make use of useSyncExternalStore.

This is particularly painful for my current work, where nearly all components make use of Zustand stores, which use useSyncExternalStore internally.


This is the same symptom that folks are hitting in #24980, but I'm not sure whether the cause is the same for everyone there.

How often does this bug happen?

Every time

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

No response

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions