Wrap generated useQuery with custom hook and return the correct typescript types #3272
Unanswered
bryanprimus
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Are there any successes? |
Beta Was this translation helpful? Give feedback.
3 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.
-
The way I currently do this is to put any in the
UseQuery<any>
genericI understand typescript need to read the types of
useQuery
param passed using genericthen i tried this
and it will not work since based on the rtk types T need to satisfy types like this
i know it needs to satisfy that by going to the place where the types are defined (go to type definition in vscode). the more I look into the types, I still couldn't find a way how to satisfy that type
Am I using the wrong types? is there a simple solution for what I am trying to achieve?
Beta Was this translation helpful? Give feedback.
All reactions