Replies: 1 comment 7 replies
-
This is intended. Since you have data in the cache available, react query will show that stale data while doing a background refetch. The isFetching flag should be true, but the status is success.
I don’t think this is anything react query has control over. It just expects something that returns a promise really. Have you checked the backend for any issues? You can also sub out your requests and just return |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am fairly new to react-query so any help would be appreciated!
We have a drop-down menu that you can change the year. Let's say the default one is
2020-21
and then you changed to2021-22
. It does fetch the data (can see loading icon, and fetching data quickly) which is good. The problem comes next. When I go back to2020-21
which It has been loaded before, it takes too long to load the data. I checked the network tap, it says pending for a while. Same again, now if I want to go back2021-22
for the 2nd time, it takes ages to load the data.I use
financialYearID
as one of the variables, so it should know that it has been changed. what I found is when you revisit the financial year, the status goes straight tosuccess
instead ofloading
. Also, it seems it doesn't know the variables(financialyear) has been changed.Again, when you select a new financial year for the first time, it is fine. then when you revisit where you have been, it takes so long to see the data so it looks like the app crashed.
Beta Was this translation helpful? Give feedback.
All reactions