Skip to content

RTKQ useQuery hook does not refetch data after resetApiState() call #3119

Closed
@emcol

Description

@emcol

The issue is likely a bug in RTKQ and should have been fixed by #1735, although it does not seem so.

I provide a minimal example that showcase the issue in isolation and I share the codebase here

Below the steps to riproduce the bug:

  • Run dev server;
  • Notice that data is properly fetched;
  • Click on reset button;

Expected results:

Data is correctly re-fetched after the API reset, the useQuery first returns a loading status and then fulfills causing the component to be re-rendered since it is subscribed to the endpoint.

Actual result:

The page gets stuck in a data loading state and useQuery hook does not fulfill blocking the user flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions