-3est[P]-
-3est[P]-4d ago

v11 with tanstack mutation not invalidate query

When the mutation is successful and the router switches to the dashboard, sometimes the data refreshes, but other times it does not. However, if I press Alt + Tab, the data refreshes.
No description
No description
3 Replies
-3est[P]-
-3est[P]-OP4d ago
ok i'm fixed it replace all useQuery to useSuspenseQuery and prefetch
Nick
Nick3d ago
Looks like you're using queryKey as the queryKey when queryKey() gives you the query key. I'm surprised TSC doesn't complain about that
-3est[P]-
-3est[P]-OP3d ago
thank it queryKey()

Did you find this page helpful?