reduxjs / redux-toolkit

The official, opinionated, batteries-included toolset for efficient Redux development
https://redux-toolkit.js.org
MIT License
10.74k stars 1.18k forks source link

resetApiState issue #4684

Open EhsanKhalili opened 3 weeks ago

EhsanKhalili commented 3 weeks ago

Hello,

After calling resetApiState, in some cases (changing page in nextjs app) APIs doesn't reinitiate and useQuery result remain undefined.

markerikson commented 3 weeks ago

Can you provide a CodeSandbox, repo, or Replay ( https://replay.io/record-bugs ) that reproduces the issue?

EhsanKhalili commented 2 weeks ago

https://app.replay.io/recording/abd111d2-fc15-4f4b-8ef1-a9271385fd80

Here is a link to a sample project on Replay that demonstrates the problem.

As you can see, I first wait for the data on the main page to load and display. Then I go to the test page and wait for the data on this page to load and display.

After the second step, I will call resetApiState API, and now APIs in pages doesn't reinitiate again