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
This is the same bug as DamianOsipiuk/vue-query#191. It was fixed in vue-query 1 but seems to have resurfaced in @tanstack/vue-query (haven't checked if was present in the vue-query 2 betas). Essentially the issue is that if you put a ref in the query key, that ref gets unwrapped at runtime, but this isn't reflected in the types.
Describe the bug
This is the same bug as DamianOsipiuk/vue-query#191. It was fixed in vue-query 1 but seems to have resurfaced in @tanstack/vue-query (haven't checked if was present in the vue-query 2 betas). Essentially the issue is that if you put a ref in the query key, that ref gets unwrapped at runtime, but this isn't reflected in the types.
Copied description from the old issue:
If you do something like:
The type of
params
will beBut at runtime the refs are unwrapped so this will just print
Object { bar: "bar" }
Your minimal, reproducible example
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgVwM4FMCKz1QJ5wC+cAZlBCHAEQACMAhgHaoMDGA1gPQBuOAtAEcc+KgG4AUKEixEcKOhJFS5SlV7ox48SWSNWMYBEZwhuPADFdrABQBKRIS1oswvNfFw4AbSokIEKgAaWQAjeigALjkFayowqCp7QgBdOHpUOFYjFkCPOGskU3wAaXQ8KK9gsHD6EFRUwnsAXgA+fKzmCAAbdAA6LogAc2tqqFrUW2Ciiys7W3FbUSA
Steps to reproduce
Just hover over the
params
type in the Typescript playgroundExpected behavior
The ref should be unwrapped in the type
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Not relevant
react-query version
4.13.3
TypeScript version
4.8.2
Additional context
No response
The text was updated successfully, but these errors were encountered: