Question about useSuspenseQuery
hello, i have a question regarding query revalidation when the previous time that query threw an error.
5 Replies
frail-apricotOP•2w ago
this problem won’t happen if i use normal useQuery hook
ambitious-aqua•2w ago
You will need to explain your problem a bit more and I highly recommend sharing some code.
If you revalidate it should fetch again.
frail-apricotOP•2w ago
whenever im using the useSuspenseQuery hook with suspense and error boundary, if the queryFn throws an error, the query won't rerun even if the component that calls the hook remount/unmount
wise-white•2w ago
You need a QueryErrorResetBoundary: https://tanstack.com/query/latest/docs/framework/react/reference/QueryErrorResetBoundary
QueryErrorResetBoundary | TanStack Query React Docs
When using suspense or throwOnError in your queries, you need a way to let queries know that you want to try again when re-rendering after some error occurred. With the QueryErrorResetBoundary compone...
frail-apricotOP•2w ago
thanks a lot