Replies: 1 comment 2 replies
-
you need the 3rd generic and need to pass it through, like so: https://codesandbox.io/s/react-query-factories-forked-pnl2l |
Beta Was this translation helpful? Give feedback.
2 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to wrap my head around how and where I should put the types when using query factories. I created a sandbox that somewhat shows how we use query factories today but I fail on TypeScript here.
Sandbox includes a simple hook that tried to infer type from the
fetchTodos()
that does not work. Another hook with a few types that does not work and a 3rd working hook that is ludicrous.https://codesandbox.io/s/react-query-factories-421nb?file=/src/todos.tsx
PS. I also tried different constellations where I put the generics on
useQuery
instead of usingUseQueryOptions
but didn't get that to work.Beta Was this translation helpful? Give feedback.
All reactions