Comments (3)
like all our functional arguments to useQuery
and useMutation
, throwOnError
is supposed to be a pure function that returns true or false, depending on which we will trigger error boundaries or not. Yes, we call this function a lot, but that shouldn't matter. If we were to memoize it, we would need to keep dependencies or you would need to memoize it with useCallback
, and we'd need to store previous results etc. This is complex because you can close over values, like count
, in this function. The only function where we do this is select
on useQuery
. For all other functions, it's just way easier to call them on each render.
i want to listen throwOnError
maybe you can explain what that means or why it matters that we call this function on every render ?
from query.
I've tried to write a custom error handler. It tries to handle the error.
If it can handle the error, it displays a modal with detailed information about the error and returns false on throwOnError
, otherwise it returns true on throwOnError
. However, this structure shows the error modal on every render.
How should I handle this case? It seems like throwOnError
is not the right choice for my case.
from query.
throwOnError is not a function you can use to perform a side effect like rendering a modal. You should render a modal depending on the error field returned from useMutation or the onError callback.
from query.
Related Issues (20)
- queries stuck on loading state in Next.js layout.tsx HOT 4
- infiniteQueryOptions can't infer type if queryFn uses pageParam HOT 1
- broadcastClient: removing query from one tab removes it from all tabs, even if others still have observers HOT 2
- [angular-query] Accessing `.data` kicks off the `CreateQueryOptions` function
- useQuery unexpected behavior when set initialData HOT 1
- Typescript 5.4.5 and useInfiniteQuery requires avoidable type annotations HOT 3
- useQueries data typed as unknown when using skipToken and TypeScript 5.4.5 HOT 2
- Why for the first page only the `queryKey`'s `pagination` is a Proxy object and for the following pages not? HOT 2
- Solid-Query example returns repositoryQuery.data is undefined HOT 2
- Bug: Dependent Query doesn't work with solid-js SSR HOT 5
- Weird bug in useQuery's select HOT 1
- Bug: Cannot read properties of null (reading '__previousQueryOptions') HOT 4
- [Bug?]: Result type of combine works not as expected HOT 1
- Bug: Error when hydrating an query that threw error HOT 1
- useQuery() hook vulnerable to type errors HOT 1
- [svelte-query] `getQueryData`/`setQueryData` fail to infer query data type from `queryOptions` HOT 3
- ESLint Plugin: Flat Config Support HOT 2
- [react-query][Bug?]When invalidating useSuspenseQuery queries with invalidateQueries, the refetch process does not run. HOT 1
- useIsFetching stops tracking queries immediately HOT 1
- Typescript issue with queryOptions and usePrefetchQuery HOT 2
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.