Is it possible to keep errors cached while refetching? #7377
Unanswered
manuel-plavsic
asked this question in
Q&A
Replies: 1 comment
-
no, this isn't really possible. We don't keep "stale errors" around. If you want that, you need to copy the error to a separate state. Error Boundaries work kinda the same way: You show the error boundary, which unmounts the component. Then, the user clicks "retry", which unmounts the boundary and mounts the component again. At that point, you'll get a loading state again. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
It seems impossible to me to refresh on an error state. I would like the error to stay cached and the query to update in the background (like with valid data).
I tried setting multiple different options; however, nothing seems to suit my use case. If I refresh on an error then
isRefreshing
is always false andisLoading
is always true. I would prefer to display a spinner next to the error (using{query.isRefetching}
) instead of reloading everything...Beta Was this translation helpful? Give feedback.
All reactions