reduxjs / react-redux

Official React bindings for Redux
https://react-redux.js.org
MIT License
23.27k stars 3.36k forks source link

useSelector hook seems to break hook parsing in React Developer Tools #2142

Closed kenlyon closed 2 months ago

kenlyon commented 2 months ago

What version of React, ReactDOM/React Native, Redux, and React Redux are you using?

What is the current behavior?

When I use the useSelector hook in my component, the Components tab of the React Developer Tools fails to parse the hooks: image

Steps to reproduce:

  1. Install the React Developer Tools extension in Firefox.
  2. Open an app that contains a component that uses the useSelector hook.
  3. Open the Developer Tools and click on the "Components" tab.
  4. Select the component in the tree and look at the "hooks" section of the right panel.

What is the expected behavior?

I expect the React Developer Tools to be able to parse the hooks without error and show the names of the variables:

image

Which browser and OS are affected by this issue?

Firefox 123.0.1, WIndows 10 Pro

Did this work in previous versions of React Redux?

timdorr commented 2 months ago

Looks like this is an upstream bug: facebook/react#27889

It may be fixed by React Dev Tools 5.0.1 or 5.0.2, either that or a uSES fix. Either way, it's not something we can fix ourselves.

kenlyon commented 2 months ago

@timdorr Thanks for the link to the relevant issue! I'm glad to see it's been fixed. Hopefully there will be a new release of the extension soon.