Describe the bug
When upgrading from 5.59.9 to 5.59.14 the types from basic infiniteQueryOptions changed so they don't work with both useInfiniteQuery and useSuspenseInfiniteQuery when you set
"compilerOptions": {
"strict": true,
"exactOptionalPropertyTypes": true
}
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-xfkpkc?file=src%2FApp.tsx
Steps to reproduce
- Go to
App.tsx
- Observe Type error on line 41 (infiniteQueryResult)
- Downgrade to
"@tanstack/react-query": "5.59.9"
- Go back to
App.tsx and observe that the Type error is gone
Expected behavior
Not having a Type error
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
react-query
TanStack Query version
5.59.14
TypeScript version
5.6.2
Additional context
No response