How to properly type useQuery's meta
?
#6045
Answered
by
TkDodo
denisborovikov
asked this question in
Q&A
-
The useQuery({ queryFn: ({ meta }) => ... }) // meta = Record<string, unknown> We can cast the type like this
but is there something better than this? |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Sep 23, 2023
Replies: 2 comments 7 replies
-
we don't have a generic for
|
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
denisborovikov
-
Is there any chance to add such generic (meaning directly in the lib, not relying on module augmentation)? |
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
we don't have a generic for
meta
so its type cannot be inferred. In v5, you can use module augmentation: