Wrong inferring in useInfiniteQuery #7301
Send to my agentDescribe the bug#
In useInfiniteQuery, thequeryFn randomly infers unknown instead of the actual data type.
Your minimal, reproducible example#
Steps to reproduce#
Hover over queryFn in useCustomHook1. The inferred type is unknown, but it is inferred correctly in useCustomHook2 and useCustomHook3.
Expected behavior#
It should always infer correctly.
How often does this bug happen?#
Sometimes
Screenshots or Videos#
Platform#
Doesn't matter
Tanstack Query adapter#
react-query
TanStack Query version#
5.29.2
TypeScript version#
5.4.5
Additional context#
No response
TkDodo closed this
TkDodo added labelsduplicate
order matters:
Actually destructuring in
queryFnis breaking inferring which I don't understand why this is happening.also part of the typescript limitation. it's outlined in the reproduction in the linked issue.
Sign in to join this conversation.
order matters: