-
There are several cases in a normal environment where react-query will re-fetch data. How can I force that in a test environment? More specifically, is there a way to force a refresh for a QueryObserver that is not used as a part of useQuery? I'm using a query observer as a sort of event emitter for a state machine, and want to force an update event. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This seems to work. Not sure if it's the optimal approach? queryClient.resetQueries() |
Beta Was this translation helpful? Give feedback.
-
queryClient.refetchQueries() I’d say |
Beta Was this translation helpful? Give feedback.
This seems to work. Not sure if it's the optimal approach?