Invalidate query doesn't work
im trying to invalidate query : queryClient.invalidateQueries({ queryKey: ["user"] }); As I understand this should trigger getQuery for "user" key and update state from API. Then somewhere in Layout i have:
Which should react to changes in user key and rerender updated layout. But this doesnt.
invalidateQueries does not trigger
What Im missing?2 Replies
correct-apricotOP•3y ago
Im using queryClient from useQueryClient(), Im not creating another queryClient by new QueryClient()
typical-coral•3y ago
getQueryData doesn't create a subscription. You want useQuery