-
As far as I can tell, there doesn't seem to be a way to get a fetched query to go back into a loading state and for it to suspend the component again after it's being fetched? Is there a mechanism for this? I have a use case where I would like my data to usually not show a loading state when background fetches are happening, but there is a certain circumstance where I do want to show it in a loading state while refetching? Any general solution for this without me having to create my own state management? If I can put the query back into loading state it would solve this for me I think |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
you can remove the query with |
Beta Was this translation helpful? Give feedback.
you can remove the query with
queryClient.removeQueries
or withremove
returned fromuseQuery
. it will remove the value from the cache, but not re-render any subscribers. If the component re-renders again, it will go into hard loading state, because it has no data, thus re-throwing to the suspense boundary.