Replies: 1 comment 3 replies
-
The thing is that the loading state means: I have nothing else to show (no data and no error). The logic happens here: query/packages/query-core/src/query.ts Lines 523 to 526 in 04945f3 I think what helps in this case is to use error boundaries. The error boundary will not mount-and-retry the component unless it was explicitly re-set. Otherwise, you an set
This might even be more what you want given that a user might copy the error, and while they are copying it the background refetch would resolve and remove the error in any case. So by just doing:
we would delay the problem, not solve it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I sometimes structure my components like this:
Now, assume this scenario:
LoadingIndicator
and focuses another tab while site loads.ErrorInfo
.refetchOnWindowFocus
kicks in. That means that:error
automatically goes tonull
, and therefore we just show theLoadingIndicator
The part that I want to prevent here is "
error
automatically goes tonull
". Is there a way to do that? I mean, to keep the error information until the query actually resolves?Beta Was this translation helpful? Give feedback.
All reactions