-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(react-query): correct type for onSuccess
of useQuery
#9242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4
Are you sure you want to change the base?
Changes from 5 commits
ba407cb
31095ca
bbe7f73
4f04215
86b46fa
e7cf33a
1f290f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
'use client' | ||
import { QueryObserver, parseQueryArgs } from '@tanstack/query-core' | ||
import { useBaseQuery } from './useBaseQuery' | ||
import type { | ||
DefinedInitialDataOptions, | ||
UndefinedInitialDataOptions, | ||
} from './queryOptions' | ||
import type { | ||
InitialDataFunction, | ||
NonUndefinedGuard, | ||
|
@@ -19,14 +15,6 @@ import type { | |
} from './types' | ||
|
||
// HOOK | ||
export function useQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
TData = TQueryFnData, | ||
TQueryKey extends QueryKey = QueryKey, | ||
>( | ||
options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, | ||
): DefinedUseQueryResult<TData, TError> | ||
Comment on lines
-22
to
-29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unnecessary function overload, and this removal will solve our issue |
||
export function useQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
|
@@ -42,14 +30,6 @@ export function useQuery< | |
| (() => NonUndefinedGuard<TQueryFnData>) | ||
}, | ||
): DefinedUseQueryResult<TData, TError> | ||
export function useQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
TData = TQueryFnData, | ||
TQueryKey extends QueryKey = QueryKey, | ||
>( | ||
options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, | ||
): UseQueryResult<TData, TError> | ||
Comment on lines
-45
to
-52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unnecessary function overload, and this removal will solve our issue |
||
export function useQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lachlancollins I revert this workflow to ensure it runs correctly. Without this change, I encounter this CI error.
https://github.com/TanStack/query/actions/runs/15422205986/job/43400032483