-
When a query initially fails, i would like to display the error and keep trying to refetch in the background using Now whenever the query is refetching, the previous error is cleared. Every five seconds the query refetches and clears the previous error while it's fetching. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
don't think so. Errors are explicitly reset when a fetch is triggered: query/packages/query-core/src/query.ts Lines 549 to 552 in b32ad24 |
Beta Was this translation helpful? Give feedback.
-
@Tarow const { error, isSuccess, isFetched } = useQuery(...);
const errorRef = useRef(error);
if (error || isSuccess) errorRef.current = error;
console.log('Preserved error:', { isFetching, error: errorRef.current }); |
Beta Was this translation helpful? Give feedback.
don't think so. Errors are explicitly reset when a fetch is triggered:
query/packages/query-core/src/query.ts
Lines 549 to 552 in b32ad24