From 9f75541ff0e59f7b2b1b5815d8190bab04e2a42e Mon Sep 17 00:00:00 2001 From: Dominik Dorfmeister Date: Sun, 30 Apr 2023 18:58:39 +0200 Subject: [PATCH 1/2] docs: deprecate callbacks on useQuery --- docs/react/reference/useQuery.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/react/reference/useQuery.md b/docs/react/reference/useQuery.md index 081c32f4b3..72bd51cb81 100644 --- a/docs/react/reference/useQuery.md +++ b/docs/react/reference/useQuery.md @@ -137,12 +137,15 @@ const { - If set to `"all"`, the component will opt-out of smart tracking and re-render whenever a query is updated. - By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - `onSuccess: (data: TData) => void` + - **Deprecated** - this callback will be removed in the next major version - Optional - This function will fire any time the query successfully fetches new data. - `onError: (error: TError) => void` + - **Deprecated** - this callback will be removed in the next major version - Optional - This function will fire if the query encounters an error and will be passed the error. - `onSettled: (data?: TData, error?: TError) => void` +- **Deprecated** - this callback will be removed in the next major version - Optional - This function will fire any time the query is either successfully fetched or errors and be passed either the data or error. - `select: (data: TData) => unknown` From c455018286732a2079277da0b020da452ea96cf3 Mon Sep 17 00:00:00 2001 From: Dominik Dorfmeister Date: Sun, 30 Apr 2023 19:01:00 +0200 Subject: [PATCH 2/2] docs: recommend the eslint plugin on installation page --- docs/react/installation.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/react/installation.md b/docs/react/installation.md index b59a58e246..d2a605dab4 100644 --- a/docs/react/installation.md +++ b/docs/react/installation.md @@ -47,3 +47,15 @@ opera >= 53 ``` > Depending on your environment, you might need to add polyfills. If you want to support older browsers, you need to transpile the library from `node_modules` yourselves. + +### Recommendations + +It is recommended to also use our [ESLint Plugin Query](./eslint/eslint-plugin-query) to help you catch bugs and inconsistencies while you code. You can install it via: + +```bash +$ npm i -D @tanstack/eslint-plugin-query +# or +$ pnpm add -D @tanstack/eslint-plugin-query +# or +$ yarn add -D @tanstack/eslint-plugin-query +```