Narrow typing the QueryKey type definition #1849
Answered
by
TkDodo
dominictwlee
asked this question in
Ideas
-
I was wondering whether having the string key as the first element of an array key is a personal preference, or something that should be enforced as a convention? It seems all the examples in the docs enforce the idea that the string key should be used:
If that's the case, would it be a good idea to narrow type the definition to something like:
|
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Feb 22, 2021
Replies: 1 comment
-
keys can be string or any array that people want, but the type inference would need some love. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dominictwlee
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
keys can be string or any array that people want, but the type inference would need some love.
unknown[]
is actually way too broad :)