Nextjs router.push is not trigger useQuery refetch when use suspend ? #4138
Replies: 1 comment
-
solved By add this setting
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using Version
Next js : 12.5.0
@tanstack/react-query: ^4.2.1
react: 18.2.0
My scenario is simple
I update staff info in detail page then invalidate query of list page then router.push to list page
The problem is the getStaffsQuery is marked as stale but never refetch again even I go to other page and then comeback .
If I unfocus the tab then focus again , it's refetched
I have tried this but it's not working
I research and found #2367 and try to set
and it's work as expected , but seem like just a workaround because I don't want to set cache time to 1
What am I doing wrong here ? What is the correct way to invalidate query of other pages that using suspend
Beta Was this translation helpful? Give feedback.
All reactions