Skip to content
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

docs: deprecate callbacks on useQuery #5407

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/query-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,20 @@ export interface QueryObserverOptions<
notifyOnChangeProps?: Array<keyof InfiniteQueryObserverResult> | 'all'
/**
* This callback will fire any time the query successfully fetches new data.
*
* @deprecated This callback will be removed in the next major version.
*/
onSuccess?: (data: TData) => void
/**
* This callback will fire if the query encounters an error and will be passed the error.
*
* @deprecated This callback will be removed in the next major version.
*/
onError?: (err: TError) => void
/**
* This callback will fire any time the query is either successfully fetched or errors and be passed either the data or error.
*
* @deprecated This callback will be removed in the next major version.
*/
onSettled?: (data: TData | undefined, error: TError | null) => void
/**
Expand Down