Comments (3)
I think there is one render cycle in between where we are still in error
state. I need to look into this. A quick workaround would be:
-if (error) {
+if (error && !isFetching) {
throw error;
}
from query.
Ah, I see what's going on. So errors are kept if you have already fetched data successfully once before, that is on purpose:
query/packages/query-core/src/query.ts
Lines 631 to 635 in e3240f0
we only reset back to a pending
state for errors where we have no data yet. So I think the docs are wrong and checking for !isFetching
is actually required.
Can you maybe file a PR to the docs?
from query.
Thank you so much! Really appreciate your quick and helpful responses ❤️
from query.
Related Issues (20)
- Query that is not enabled returns the result stored in the cache HOT 5
- preserveSymlinks breaks useQuery return type HOT 1
- React Query v5.48.0 Cannot read properties of undefined (reading 'length') when using infinite queries HOT 3
- Enabled exactOptionalPropertyTypes causes error when trying to use the optional selector HOT 1
- getNextPageParam throws an error when setting the data for an infinite query to empty lists for pages & pageParams
- Typescript error when await on global onSuccess mutation HOT 3
- Version 5.50 isn't on npm HOT 1
- eslint-plugin-query: skipToken breaks exhaustive queryKeys rule HOT 3
- JSDoc return type inference broken for useQuery/createQuery, but not for useMutation/createMutation HOT 1
- Svelte: passing a store to createQuery breaks types when using `select` HOT 2
- `useIsFetching` is reacting only to first static queryKey HOT 2
- QueryCache in QueryClient is not reflecting state changes inside onError callback HOT 1
- persisted queries are not removed from cache HOT 1
- `useSuspenseInfiniteQuery` does not create correct data HOT 1
- `vue-query` client `invalidateQueries` doesn't invalidate immediately HOT 3
- Query remains active even without any listeners HOT 3
- react-native resolve problem HOT 1
- Using refreshInterval and staleTime can cause refresh to only occur after refetchInterval + staleTime HOT 1
- `AbortSignal` does not fire when query errors out HOT 6
- typescript error querykey is missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from query.