Skip to content

useSelector stopped firing all of a sudden #1836

@ebitogu

Description

@ebitogu

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

  • React: ^17.0.2
  • ReactDOM/React Native:
  • Redux:^4.1.2
  • React Redux:^7.2.6

What is the current behavior?

useSelector is no longer firing when actions are dispatched via useDispatch
const currentPageIndex = useSelector((state) => state.pageReducer[Constants.ReduxActions.CURRENT_PAGE] ?? defaultPage);

//CurrentPageIndex always returns 0 which is the default page even though dispatch has fired an action to change that.

What is the expected behavior?

I expect that when dispatch is called useSelector should pick up the latest changes.

Please note that this was all working perfectly until recently when I noticed that the useSelector hook is no longer firing.

Which browser and OS are affected by this issue?

All browsers

Did this work in previous versions of React Redux?

  • Yes

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