Feature request: Allow some variable names from @tanstack/query/exhaustive-deps #7276
Unanswered
rhuanbarreto
asked this question in
Ideas
Replies: 1 comment
-
if your code looks like this:
then the rule is technically correct because you are closing over The real question is: Why is
but ideally, all of this would live outside of react ... |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I normally create custom hooks that return queries that depends on other values, like an authentication token. I use the authentication token in queryFn but then the eslint rule @tanstack/query/exhaustive-deps requires the token to be in the query key, which is not good once authentication tokens are not supposed to be part of a query key.
It would be good to configure the rule with a list of allowed names to not require them in the queryKey, like
token
Beta Was this translation helpful? Give feedback.
All reactions