Closed alisamonstr closed 1 month ago
Do you think adding | undefined
here would fix it?
Do you think adding
| undefined
here would fix it?
(same team) It doesn't fix it because infiniteQueryOptions
still matches UnusedSkipTokenInfiniteOptions
, which isn't supported by any of the useInifiniteQuery overloads. Previously, our infiniteQueryOptions
used the UndefinedInitialDataInfiniteOptions
type.
@gwansikk I think this traces back to your PR:
could you please have a look?
I have reviewed the example project you provided, but I couldn’t reproduce the bug you mentioned. Could you please provide more detailed information about the issue?
I have reviewed the example project you provided, but I couldn’t reproduce the bug you mentioned. Could you please provide more detailed information about the issue?
Try adding "exactOptionalPropertyTypes": true
to the tsconfig.app.json
file. It seems like it it wasn't always enough to just have it in the tsconfig.json
.
You should see an error like this:
Try adding "exactOptionalPropertyTypes": true to the tsconfig.app.json file. It seems like it it wasn't always enough to just have it in the tsconfig.json.
@alvarlagerlof Thank you! I will look into finding an appropriate solution as soon as possible.
Do you think adding
| undefined
here would fix it?query/packages/react-query/src/infiniteQueryOptions.ts
Lines 50 to 62 in a085c92
& { queryFn?: Exclude< UseInfiniteQueryOptions< TQueryFnData, TError, TData, TQueryFnData, TQueryKey, TPageParam ['queryFn'], SkipToken
}
I realize now that I misinterpreted this and didn't add the | undefined
at the right place in my local edit when testing. Anyways the fix worked. Thanks everyone!
Describe the bug
When upgrading from
5.59.9
to5.59.14
the types from basicinfiniteQueryOptions
changed so they don't work with bothuseInfiniteQuery
anduseSuspenseInfiniteQuery
when you setYour minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-xfkpkc?file=src%2FApp.tsx
Steps to reproduce
App.tsx
"@tanstack/react-query": "5.59.9"
App.tsx
and observe that the Type error is goneExpected 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