onSettled throws Cannot update a component (HotReload
) while rendering a different component
#6710
Unanswered
AndonMitev
asked this question in
General
Replies: 1 comment
-
I've got the same issue with With useSuspenseQuery it only fails when there's an error on the request, then it gives as error this (...)
return (
<QueryClientProvider client={queryClient}>
<ReactQueryStreamedHydration>{children}</ReactQueryStreamedHydration>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
); I can see on nextJS static apps useQuery also gives hydration issues when queries fail. |
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
-
Stack:
I have server component that is prefetching data and passing and storing in cache. Then i have mutation that is updating the state which is OK until i add this line of code:
onSettled: async () => await queryClient.invalidateQueries({ queryKey: ['products'] })
also tried like this:
onSettled: () => queryClient.invalidateQueries({ queryKey: ['products'] })
QueryClientProvider:
full mutation looks like this:
Issue that i'm facing is:
Not sure why is happening, tried to do optimistic update and filter variables from products and status pending and indeed i can see the variable coming from
But then error occurs and and app is crashing, if this line is commented IN:
onSettled: async () => await queryClient.invalidateQueries({ queryKey: ['products'] })
everything works no problems, any ideas?
Beta Was this translation helpful? Give feedback.
All reactions