Skip to content

Make useSelector value inspectable in dev tools #1613

Closed
@dimaqq

Description

@dimaqq

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions