Cancel the Reload on Refetch #4602
-
Hi, Not sure if this is intentional but every time I use the refetch method my component or the page itself reloads for some reason. can't find any information on how to disable this. Only found two options for refetch which are the throw error and cancel refetch. I'm also pretty sure that it really reloads since all of my component states go back to their initial state. Heres my flow: The refetch method is inside a context and I use useContext to get it on my component Saving Part
When saving is successful call the refetch method
The context file
My goal is that to refetch the data without reloading the page. Right now my fix is to not use the useQuery at all and just use a regular fetch API |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
most certainly not on purpose, and I've never seen a behaviour like this produced by react-query. Must be something else :) I would be surprised if you could reproduce this issue in isolation, but I'll take a look if you can :) |
Beta Was this translation helpful? Give feedback.
most certainly not on purpose, and I've never seen a behaviour like this produced by react-query. Must be something else :)
I would be surprised if you could reproduce this issue in isolation, but I'll take a look if you can :)