onSettled throws annot update a component (`HotReload`) while rendering a different component
Stack:
I have server component that is prefetching data and storing in cache. Then i have mutation that is updating the state which is OK until i add this line of code:
also tried like this:
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
But then error occurs and and app is crashing, if this line is commented IN:
everything works no problems, any ideas?
"next": "14.0.4""@tanstack/react-query": "^5.17.12"I have server component that is prefetching data and storing in cache. Then i have mutation that is updating the state which is OK until i add this line of code:
also tried like this:
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?