Skip to content

Commit

Permalink
Update typescript & Patch Hook Types (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans authored Sep 23, 2024
1 parent 1c2aa83 commit 26e0207
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 61 deletions.
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"@ensdomains/ens-contracts": "1.0.0",
"@ensdomains/ens-test-env": "workspace:*",
"ts-node": "^10.9.2",
"typescript": "5.3.2",
"viem": "2.9.2",
"tslib": "^2.7.0",
"typescript": "5.6.2",
"viem": "2.9.2",
"wagmi": "^2"
},
"peerDependencies": {
Expand Down
8 changes: 3 additions & 5 deletions packages/react/src/hooks/useQuery.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
useQuery as useTanstackQuery,
type DefaultError,
type DefinedUseQueryResult,
type QueryKey,
type UseQueryOptions,
type UseQueryResult,
} from '@tanstack/react-query'
import type { ExactPartial } from 'viem'
import { fallbackQueryClient } from '../query.js'
Expand All @@ -29,7 +29,7 @@ export type UseQueryParameters<
export type UseQueryReturnType<
Data = unknown,
Error = DefaultError,
> = UseQueryResult<Data, Error>
> = DefinedUseQueryResult<Data, Error>

export const useQuery = <
Parameters extends UseQueryParameters,
Expand All @@ -46,9 +46,7 @@ export const useQuery = <
queryKey: key,
}

// TODO: figure out why this is necessary
// @ts-ignore
return useTanstackQuery(
return useTanstackQuery<Data, Error>(
{ ...parameters } as any,
queryConfig?.queryClient ?? fallbackQueryClient,
)
Expand Down
Loading

0 comments on commit 26e0207

Please sign in to comment.