Skip to content

[Feature request] Leverage useDebugValue in useSelector #1525

Closed
@Finesse

Description

@Finesse

Debugging components with the useSelector hook is more complicated that it could be. In order to see a useSelector return value, I have to put console.log in my code or dive deep into the hook to find the internal useState that stores the current selector value. React has a browser extension that shows inner state of React tree, components and hooks, and provides a way to attach a value to a hook in the extension UI:

image

The useSelector hook may call useDebugValue to show the current selected value next to the hook in the hooks list of the extension UI (like the built-in hooks do). It would be very handy.

I don't know whether using the hook impacts the performance. Using the hook only during development would be sufficient.

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