Conditional Query Key #6412
Unanswered
IdoBouskila
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I think two separate hooks are more idiomatic; you not only change the key, but also the complete queryFn implementation:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I have a component that uses this hook, The query key is changed depending if projectId value is truthy.
There are 2 ways that I thought about to get the same results:
projectId
parameter.The first way looks better to me, but I'd like to ask what do you suggest? (I didn't find a mention of a similar scenario in the docs)
Beta Was this translation helpful? Give feedback.
All reactions