useQuery enabled option with TypeScript #5252
-
I've got this custom hook which fetches all the players in a game using the
Issue is, I have to wait for the router to be ready and to make sure it's got the I get round this by just casting it like so - |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi 👋 Type safety with the enabled option can be achieved in various ways. Please see: https://tkdodo.eu/blog/react-query-and-type-script#type-safety-with-the-enabled-option |
Beta Was this translation helpful? Give feedback.
Hi 👋
Type safety with the enabled option can be achieved in various ways. Please see: https://tkdodo.eu/blog/react-query-and-type-script#type-safety-with-the-enabled-option