useQuery + query-key-factory formatting question #6586
Unanswered
div-cowboy
asked this question in
Q&A
Replies: 1 comment
-
if you have TS errors, please show a typescript playground: |
Beta Was this translation helpful? Give feedback.
0 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.
-
In a previous app I built, I used the following pattern which I loved, but when I tried to setup a new project this weekend, I started getting this error. The functionality works as intended (hydration + prefetch), but I can't figure out how to remove this type error. Appreciate any guidance on this 🙏
No overload matches this call.
The last overload gave the following error.
Argument of type '{ queryFn: QueryFunction<any, readonly ["posts", "allPosts", string]>; queryKey: readonly ["posts", "allPosts", string]; }' is not assignable to parameter of type 'QueryKey'.
Type '{ queryFn: QueryFunction<any, readonly ["posts", "allPosts", string]>; queryKey: readonly ["posts", "allPosts", string]; }' is missing the following properties from type 'readonly unknown[]': length, concat, join, slice, and 26 more.ts(2769)
useQuery.d.ts(16, 25): The last overload is declared here.
useAllPosts.tsx
single-post.ts
queries.ts
post.ts
package.json
Beta Was this translation helpful? Give feedback.
All reactions