Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make useSelector value inspectable in dev tools #1613

Closed
dimaqq opened this issue Jul 13, 2020 · 4 comments
Closed

Make useSelector value inspectable in dev tools #1613

dimaqq opened this issue Jul 13, 2020 · 4 comments

Comments

@dimaqq
Copy link

dimaqq commented Jul 13, 2020

New Features

I would love it if I could see the values that useSelector() returns in the react dev tools, in the hooks section of the component details.

Today I can get to the value, but it requires several clicks, and it's a bit unclear, as it's shown as 1 of 3 Ref's:

Screenshot 2020-07-13 at 17 28 30

Arguably the returned value could large (hairy nested object, large string), thus, some heuristic is needed to truncate the representation.

Naive implementation is easy with useDebugValue() but the above is a concern.

What is the new or updated feature that you are suggesting?

New

Why should this feature be included?

  • to improve developer experience
  • to appear similar to useState
  • library user cannot do this in their component code

What docs changes are needed to explain this?

Eh?

@markerikson
Copy link
Contributor

Already done in #1525 and #1530 - we just have been very slow in releasing a new build.

I will attempt to get a new build out in the next day or so.

@markerikson
Copy link
Contributor

Finally live in https://github.com/reduxjs/react-redux/releases/tag/v7.2.1

@dimaqq
Copy link
Author

dimaqq commented Jul 27, 2020

🎉 Fantastic! 🎉
(undefined is expected)
Screenshot 2020-07-27 at 9 31 20

P.S. now if there were a babel macro to annotate the purpose of selector, e.g. the variable name from const token_claims = useSelector(...) :wishful-thinking:

@th3fallen

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants