You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented cancelation in my project, but it does not seem to work when working with Suspense and useSuspenseQuery / useSuspenseQueries hooks.
I have tested with useQuery and it works perfectly.
I don't see any mention in the documentation that the cancelation does not work with suspense, and don't see at first sight any reason it would be impossible to cancel queries when working with Suspense.
Describe the bug
Hello,
I have implemented cancelation in my project, but it does not seem to work when working with
SuspenseanduseSuspenseQuery/useSuspenseQuerieshooks.I have tested with
useQueryand it works perfectly.I don't see any mention in the documentation that the cancelation does not work with suspense, and don't see at first sight any reason it would be impossible to cancel queries when working with Suspense.
Thanks for the library which is really cool :)
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-5dtu8c?file=src%2FApp.tsx
Steps to reproduce
id: countps: it's also possible to simulate the unmounting of the component while a request is running (it does not cancelled the request too)
Expected behavior
I expect that running queries are cancelled
How often does this bug happen?
Every time
Screenshots or Videos
Cancelation working with
useQuery:Enregistrement.de.l.ecran.2024-08-12.a.14.33.11.mov
Cancelation not working with
useSuspenseQuery:Enregistrement.de.l.ecran.2024-08-12.a.14.32.25.mov
Platform
Tanstack Query adapter
react-query
TanStack Query version
5.51.23
TypeScript version
5.5.4
Additional context
No response