Replies: 2 comments 1 reply
-
The
Please show at least some code for this because it doesn't make much sense to me. The key is what identifies the place in the cache so without a key, nothing can work |
Beta Was this translation helpful? Give feedback.
-
So I followed this discussion to create my own hooks #3227 Here's a code example:
Then, if I consume the query like: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Previously, with v4, we were not setting up the
queryKey
in the options. Now, after updating to v5, we are required to pass thequeryKey
as an option.Is this the right behavior or is it a regression?
Your minimal, reproducible example
/
Steps to reproduce
UseQueryOptions options
paramrefetchInterval
for example.queryKey
as well.Expected behavior
I don't know if this is the right behavior or the direction to follow, but in my opinion it should be again an optional prop. Otherwise, the queryKey is defined twice (being overwritten by the options I guess). One when defining the query and another one when consuming that query with options param.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
react-query
TanStack Query version
5.14.0
TypeScript version
5.1.6
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions