TanStackT
TanStack3y ago
22 replies
standard-azure

Removing callbacks from useQuery

Is this the right patch to remove the callbacks from
useQuery
's options?

diff --git a/src/types.ts b/src/types.ts
index 9426089293bb7b217e4aa156a6ec21c79a8e4c19..1d2ef5e8628069f8f8928e392ea8f32c6d7d1339 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -202,24 +202,6 @@ export interface QueryObserverOptions<
    * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.
    */
   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
   /**
    * Whether errors should be thrown instead of setting the `error` property.
    * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.


currently trying to trigger something that will lint or typecheck with an error whenever I use those callbacks - I added https://github.com/gund/eslint-plugin-deprecation, but it seems the react queries are too complicated for it to detect those doc comments...
Was this page helpful?