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)
- Type Error when using `useQueries` with results returning different types, generated from an array HOT 3
- Disabled query is run when useQuery is nested within a usePrefetchQuery HOT 1
- Refetch query not working in react router
- useInfiniteQuery getNextPageParam and getPreviousPageParam are called even when isEnabled is false HOT 1
- exhaustive-deps incorrectly treats external value as dependency HOT 1
- Typescript does not consider that the data returned by the useQuery hook can be undefined HOT 2
- QueryCache onError skips all other try/catch blocks and throws a global error HOT 1
- Angular query devtools are included in production builds HOT 6
- docs: link to typescript page is dead in Angular Query Options
- prefetchQuery not working in Next.js dynamic routes HOT 1
- `useSuspenseQuery` has incorrect behavior on `select` errors HOT 7
- Angular injectMutation: `onSuccess` loses type when `queryClient` is passed to `injectMutation`
- Crash in iOS Production Mode with Expo React Native and TanStack React Query HOT 5
- Infinite query page param resets back to the first page during refetch if a page request is retried
- v5.56.1 breaks trpc HOT 7
- `setQueryData` not persisting data with `PersistQueryClientProvider` HOT 1
- Devtools throw error when resetting loading after query fails with no data. HOT 1
- [vue-query] `shallow: false` can lead to identity hazards
- `invalidateQueries` inconsistently cancels `fetchQuery` HOT 5
- queryOptions passed to QueryClient.fetchQuery produce a Typescript error HOT 1
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.