You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type error: No overload matches this call.
Overload 1 of 3, '(queryKey: QueryKey, options?: Omit<UseQueryOptions<[Trade], unknown, [Trade], QueryKey>, "queryKey"> | undefined): UseQueryResult<...>', gave the following error.
Argument of type 'string' is not assignable to parameter of type 'QueryKey'.
Overload 2 of 3, '(queryKey: QueryKey, queryFn: QueryFunction<[Trade], QueryKey>, options?: Omit<UseQueryOptions<[Trade], unknown, [Trade], QueryKey>, "queryKey" | "queryFn"> | undefined): UseQueryResult<...>', gave the following error.
Argument of type 'string' is not assignable to parameter of type 'QueryKey'.
11 | const queryClient = useQueryClient()
12 |
> 13 | const { data } = useQuery(myQueryKey, async () => {
Describe the bug
where
If I change it to
const { data } = useQuery([myQueryKey], async () => {
then it's fine, but this used to work in non-beta.Your minimal, reproducible example
^
Steps to reproduce
useQuery with variable as key
Expected behavior
no compiler error
How often does this bug happen?
No response
Screenshots or Videos
No response
Platform
macOS
react-query version
4.0.0-beta.3
TypeScript version
4.6.3
Additional context
No response
The text was updated successfully, but these errors were encountered: