Repository: TanStack/query
Pull request #5653 (2023-06-30 19:28:16)

docs(query-keys): clarify query key refetching

Update the query-key documentation to note that changing data included in a query key will automatically refetch the query data.

It took me awhile to find this information, and I expected to find it here. I consulted with another engineer on our team, and they agreed that they would expect to see it stated more clearly here. So we felt this addition would be helpful for people trying to onboard to React Query.

vercel[bot]: [vc]: #+2xDZ3rPCsMruuYlZBIehJxGYqb5Spe+LDb47FiN9a0=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJxdWVyeSIsInJvb3REaXJlY3RvcnkiOiJkb2NzIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6IiJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vdGFuc3RhY2svcXVlcnkvNTVZWXg3QXZBVWVXeWRLYkxMUmJ0aWVuZG1TVCIsIm5leHRDb21taXRTdGF0dXMiOiJQRU5ESU5HIn1dfQ==
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **query** | 🔄 Building ([Inspect](https://vercel.com/tanstack/query/55YYx7AvAUeWydKbLLRbtiendmST)) |  |  | Jun 30, 2023 7:28pm |



Patch:
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 1dcd1c34a..b2653165a 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -5,6 +5,7 @@ const config = {
   extends: [
     'plugin:@typescript-eslint/eslint-recommended',
     'plugin:@typescript-eslint/recommended',
+    'plugin:import/recommended',
     'plugin:import/typescript',
     'prettier',
   ],
@@ -41,15 +42,38 @@ const config = {
     '@typescript-eslint/no-explicit-any': 'off',
     '@typescript-eslint/no-non-null-assertion': 'off',
     '@typescript-eslint/no-unnecessary-condition': 'error',
+    '@typescript-eslint/no-unused-vars': 'off',
     '@typescript-eslint/no-inferrable-types': [
       'error',
       { ignoreParameters: true },
     ],
+    'import/default': 'off',
+    'import/export': 'off',
+    'import/namespace': 'off',
+    'import/newline-after-import': 'error',
     'import/no-cycle': 'error',
+    'import/no-duplicates': 'off',
+    'import/no-named-as-default-member': 'off',
     'import/no-unresolved': ['error', { ignore: ['^@tanstack/'] }],
     'import/no-unused-modules': ['off', { unusedExports: true }],
+    'import/order': [
+      'error',
+      {
+        groups: [
+          'builtin',
+          'external',
+          'internal',
+          'parent',
+          'sibling',
+          'index',
+          'object',
+          'type',
+        ],
+      },
+    ],
     'no-redeclare': 'off',
     'no-shadow': 'error',
+    'sort-imports': ['error', { ignoreDeclarationSort: true }],
   },
   overrides: [
     {
diff --git a/docs/react/guides/infinite-queries.md b/docs/react/guides/infinite-queries.md
index 53d995184..a7e640373 100644
--- a/docs/react/guides/infinite-queries.md
+++ b/docs/react/guides/infinite-queries.md
@@ -199,7 +199,7 @@ useInfiniteQuery({
 
 ## What if I want to manually update the infinite query?
 
-Manually removing first page:
+### Manually removing first page:
 
 [//]: # 'Example6'
 
@@ -212,7 +212,7 @@ queryClient.setQueryData(['projects'], (data) => ({
 
 [//]: # 'Example6'
 
-Manually removing a single value from an individual page:
+### Manually removing a single value from an individual page:
 
 [//]: # 'Example7'
 
@@ -230,4 +230,17 @@ queryClient.setQueryData(['projects'], (data) => ({
 
 [//]: # 'Example7'
 
-Make sure to keep the same data structure of pages and pageParams!
+### Keep only the first page:
+
+[//]: # 'Example8'
+
+```tsx
+queryClient.setQueryData(['projects'], (data) => ({
+  pages: data.pages.slice(0,1),
+  pageParams: data.pageParams.slice(0,1),
+}))
+```
+
+[//]: # 'Example8'
+
+Make sure to always keep the same data structure of pages and pageParams!
diff --git a/docs/react/guides/query-keys.md b/docs/react/guides/query-keys.md
index 78e52d076..173b8ef13 100644
--- a/docs/react/guides/query-keys.md
+++ b/docs/react/guides/query-keys.md
@@ -90,6 +90,8 @@ function Todos({ todoId }) {
 ```
 
 [//]: # 'Example5'
+
+Note that query keys act as dependencies for your query functions. Adding dependent variables to your query key will ensure that queries are cached independently, and that any time a variable changes, *queries will be refetched automatically (depending on your `staleTime` settings).* (See the [exhaustive-deps](../eslint/exhaustive-deps) section for more information and examples.)
 [//]: # 'Materials'
 
 ## Further reading
diff --git a/docs/react/guides/ssr.md b/docs/react/guides/ssr.md
index 87b926743..6e0419bd9 100644
--- a/docs/react/guides/ssr.md
+++ b/docs/react/guides/ssr.md
@@ -417,7 +417,7 @@ Fetch your data in a Server Component higher up in the component tree than the C
 - Wrap the component tree that needs the prefetched queries inside `<Hydrate>`, and provide it with the dehydrated state
 - You can fetch inside multiple Server Components and use `<Hydrate>` in multiple places
 
-> NOTE: TypeScript currently complains of a type error when using async Server Components. As a temporary workaround, use `{/* @ts-expect-error Server Component */}` when calling this component inside another. For more information, see [End-to-End Type Safety](https://beta.nextjs.org/docs/configuring/typescript#end-to-end-type-safety) in the Next.js 13 beta docs.
+> NOTE: If you encounter a type error while using async Server Components with TypeScript versions lower than `5.1.3` and `@types/react` versions lower than `18.2.8`, it is recommended to update to the latest versions of both. Alternatively, you can use the temporary workaround of adding `{/* @ts-expect-error Server Component */}` when calling this component inside another. For more information, see [Async Server Component TypeScript Error](https://nextjs.org/docs/app/building-your-application/configuring/typescript#async-server-component-typescript-error) in the Next.js 13 docs.
 
 ```tsx
 // app/hydratedPosts.jsx
diff --git a/docs/react/reference/useMutation.md b/docs/react/reference/useMutation.md
index 6fd0f46f9..50233b23c 100644
--- a/docs/react/reference/useMutation.md
+++ b/docs/react/reference/useMutation.md
@@ -51,7 +51,7 @@ mutate(variables, {
   - If set to `Infinity`, will disable garbage collection
 - `mutationKey: unknown[]`
   - Optional
-  - A mutation key can be set to inherit defaults set with `queryClient.setMutationDefaults` or to identify the mutation in the devtools.
+  - A mutation key can be set to inherit defaults set with `queryClient.setMutationDefaults`.
 - `networkMode: 'online' | 'always' | 'offlineFirst`
   - optional
   - defaults to `'online'`
diff --git a/docs/svelte/overview.md b/docs/svelte/overview.md
index 14fb67c81..e9c130ed7 100644
--- a/docs/svelte/overview.md
+++ b/docs/svelte/overview.md
@@ -9,7 +9,7 @@ The `@tanstack/svelte-query` package offers a 1st-class API for using TanStack Q
 
 Include the QueryClientProvider near the root of your project:
 
-```markdown
+```svelte
 <script lang="ts">
   import { QueryClient, QueryClientProvider } from '@tanstack/svelte-query'
   import Example from './lib/Example.svelte'
@@ -24,7 +24,7 @@ Include the QueryClientProvider near the root of your project:
 
 Then call any function (e.g. createQuery) from any component:
 
-```markdown
+```svelte
 <script lang="ts">
   import { createQuery } from '@tanstack/svelte-query'
 
diff --git a/docs/svelte/reactivity.md b/docs/svelte/reactivity.md
index 6c7f8875e..e99f97c7f 100644
--- a/docs/svelte/reactivity.md
+++ b/docs/svelte/reactivity.md
@@ -7,7 +7,7 @@ Svelte uses a compiler to build your code which optimises rendering. By default,
 
 In the below example, the `refetchInterval` option is set from the variable `intervalMs`, which is edited by the input field. However, as the query is not told it should react to changes in `intervalMs`, `refetchInterval` will not change when the input value changes.
 
-```markdown
+```svelte
 <script lang="ts">
   import { createQuery } from '@tanstack/svelte-query'
 
@@ -27,7 +27,7 @@ In the below example, the `refetchInterval` option is set from the variable `int
 
 To solve this, you can prefix the query with `$: ` to tell the compiler it should be reactive.
 
-```markdown
+```svelte
 <script lang="ts">
   import { createQuery } from '@tanstack/svelte-query'
 
diff --git a/docs/svelte/ssr.md b/docs/svelte/ssr.md
index 8a4141a6d..1a8047743 100644
--- a/docs/svelte/ssr.md
+++ b/docs/svelte/ssr.md
@@ -11,7 +11,7 @@ The recommended way to achieve this is to use the `browser` module from SvelteKi
 
 **src/routes/+layout.svelte**
 
-```markdown
+```svelte
 <script lang="ts">
   import { browser } from '$app/environment'
   import { QueryClient, QueryClientProvider } from '@tanstack/svelte-query'
@@ -52,7 +52,7 @@ export const load: PageLoad = async () => {
 ```
 
 **src/routes/+page.svelte**
-```markdown
+```svelte
 <script>
   import { createQuery } from '@tanstack/svelte-query'
   import type { PageData } from './$types'
@@ -104,7 +104,7 @@ export const load: LayoutLoad = async () => {
 
 **src/routes/+layout.svelte**
 
-```markdown
+```svelte
 <script lang="ts">
   import { QueryClientProvider } from '@tanstack/svelte-query'
   import type { LayoutData } from './$types'
@@ -135,7 +135,7 @@ export const load: PageLoad = async ({ parent, fetch }) => {
 
 **src/routes/+page.svelte**
 
-```markdown
+```svelte
 <script lang="ts">
   import { createQuery } from '@tanstack/svelte-query'
 
diff --git a/docs/vue/devtools.md b/docs/vue/devtools.md
index 44b6d09f0..f6a93fb08 100644
--- a/docs/vue/devtools.md
+++ b/docs/vue/devtools.md
@@ -7,7 +7,7 @@ Wave your hands in the air and shout hooray because Vue Query comes with dedicat
 
 When you begin your Vue Query journey, you'll want these devtools by your side. They help visualize all of the inner workings of Vue Query and will likely save you hours of debugging if you find yourself in a pinch!
 
-The only thing you need to do is to install official **[Vue Devtools](https://devtools.vuejs.org/guide/installation.html)**
+The only thing you need to do is to install the official **[Vue Devtools](https://devtools.vuejs.org/guide/installation.html)**.
 
-Vue Query will seemingly integrate with official devtools, adding custom inspector and timeline events.
-Devtools would be treeshaken from production bundles by default.
+Vue Query will seamlessly integrate with the official devtools, adding custom inspector and timeline events.
+Devtool code will be treeshaken from production bundles by default.
diff --git a/docs/vue/guides/infinite-queries.md b/docs/vue/guides/infinite-queries.md
index 18dc2cbf4..e84309d52 100644
--- a/docs/vue/guides/infinite-queries.md
+++ b/docs/vue/guides/infinite-queries.md
@@ -71,18 +71,3 @@ const skipToCursor50 = () => fetchNextPage({ pageParam: 50 })
 ```
 
 [//]: # 'Example3'
-[//]: # 'Example7'
-
-```tsx
-const newPagesArray =
-  oldPagesArray?.pages.map((page) =>
-    page.filter((val) => val.id !== updatedId),
-  ) ?? []
-
-queryClient.setQueryData(['projects'], (data) => ({
-  pages: newPagesArray,
-  pageParams: data.pageParams,
-}))
-```
-
-[//]: # 'Example7'
diff --git a/package.json b/package.json
index 9aef78282..449157f06 100644
--- a/package.json
+++ b/package.json
@@ -76,7 +76,8 @@
     "jest": "^27.5.1",
     "jsonfile": "^6.1.0",
     "luxon": "^2.3.2",
-    "nx": "16.0.1",
+    "nx": "16.5.2",
+    "nx-cloud": "16.1.0",
     "prettier": "^2.6.2",
     "prettier-plugin-svelte": "^2.9.0",
     "react": "^18.2.0",
@@ -96,8 +97,7 @@
     "ts-jest": "^27.1.1",
     "ts-node": "^10.7.0",
     "typescript": "^4.7.4",
-    "vue": "^3.2.33",
-    "nx-cloud": "16.0.5"
+    "vue": "^3.2.33"
   },
   "bundlewatch": {
     "files": [
diff --git a/packages/eslint-plugin-query/package.json b/packages/eslint-plugin-query/package.json
index 67a5612db..3b32cf0fb 100644
--- a/packages/eslint-plugin-query/package.json
+++ b/packages/eslint-plugin-query/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/eslint-plugin-query",
-  "version": "4.29.9",
+  "version": "4.29.25",
   "description": "ESLint plugin for TanStack Query",
   "author": "Eliya Cohen",
   "license": "MIT",
diff --git a/packages/eslint-plugin-query/src/configs/index.ts b/packages/eslint-plugin-query/src/configs/index.ts
index e5e5aba26..04503290a 100644
--- a/packages/eslint-plugin-query/src/configs/index.ts
+++ b/packages/eslint-plugin-query/src/configs/index.ts
@@ -1,5 +1,5 @@
-import type { TSESLint } from '@typescript-eslint/utils'
 import { rules } from '../rules'
+import type { TSESLint } from '@typescript-eslint/utils'
 
 function generateRecommendedConfig(
   allRules: Record<string, TSESLint.RuleModule<any, any>>,
diff --git a/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.rule.ts b/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.rule.ts
index 4ce3b30c9..472bdeb9f 100644
--- a/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.rule.ts
+++ b/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.rule.ts
@@ -1,9 +1,9 @@
-import type { TSESLint } from '@typescript-eslint/utils'
 import { AST_NODE_TYPES } from '@typescript-eslint/utils'
 import { ASTUtils } from '../../utils/ast-utils'
 import { createRule } from '../../utils/create-rule'
 import { uniqueBy } from '../../utils/unique-by'
 import { ExhaustiveDepsUtils } from './exhaustive-deps.utils'
+import type { TSESLint } from '@typescript-eslint/utils'
 
 const QUERY_KEY = 'queryKey'
 const QUERY_FN = 'queryFn'
diff --git a/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.utils.ts b/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.utils.ts
index f60bf20ca..8b146b0b5 100644
--- a/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.utils.ts
+++ b/packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.utils.ts
@@ -1,6 +1,6 @@
-import type { TSESLint } from '@typescript-eslint/utils'
 import { AST_NODE_TYPES } from '@typescript-eslint/utils'
 import { ASTUtils } from '../../utils/ast-utils'
+import type { TSESLint } from '@typescript-eslint/utils'
 
 export const ExhaustiveDepsUtils = {
   isRelevantReference(params: {
diff --git a/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.ts b/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.ts
index b55b861d1..abef567f9 100644
--- a/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.ts
+++ b/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.ts
@@ -1,8 +1,8 @@
-import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 import { AST_NODE_TYPES } from '@typescript-eslint/utils'
 import { createRule } from '../../utils/create-rule'
 import { ASTUtils } from '../../utils/ast-utils'
 import { objectKeys } from '../../utils/object-utils'
+import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 
 const QUERY_CALLS = {
   useQuery: { key: 'queryKey', fn: 'queryFn', type: 'query' },
diff --git a/packages/eslint-plugin-query/src/utils/ast-utils.ts b/packages/eslint-plugin-query/src/utils/ast-utils.ts
index 540063325..29d18f54f 100644
--- a/packages/eslint-plugin-query/src/utils/ast-utils.ts
+++ b/packages/eslint-plugin-query/src/utils/ast-utils.ts
@@ -1,8 +1,8 @@
+import { AST_NODE_TYPES } from '@typescript-eslint/utils'
+import { uniqueBy } from './unique-by'
 import type { TSESLint, TSESTree } from '@typescript-eslint/utils'
 import type TSESLintScopeManager from '@typescript-eslint/scope-manager'
-import { AST_NODE_TYPES } from '@typescript-eslint/utils'
 import type { RuleContext } from '@typescript-eslint/utils/dist/ts-eslint'
-import { uniqueBy } from './unique-by'
 
 export const ASTUtils = {
   isNodeOfOneOf<T extends AST_NODE_TYPES>(
diff --git a/packages/eslint-plugin-query/src/utils/create-rule.ts b/packages/eslint-plugin-query/src/utils/create-rule.ts
index f2aab9298..f8962fafc 100644
--- a/packages/eslint-plugin-query/src/utils/create-rule.ts
+++ b/packages/eslint-plugin-query/src/utils/create-rule.ts
@@ -1,6 +1,6 @@
 import { ESLintUtils } from '@typescript-eslint/utils'
-import type { EnhancedCreate } from './detect-react-query-imports'
 import { detectTanstackQueryImports } from './detect-react-query-imports'
+import type { EnhancedCreate } from './detect-react-query-imports'
 
 const getDocsUrl = (ruleName: string): string =>
   `https://tanstack.com/query/v4/docs/eslint/${ruleName}`
diff --git a/packages/query-async-storage-persister/package.json b/packages/query-async-storage-persister/package.json
index a20353908..113ffad44 100644
--- a/packages/query-async-storage-persister/package.json
+++ b/packages/query-async-storage-persister/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/query-async-storage-persister",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "A persister for asynchronous storages, to be used with TanStack/Query",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/query-async-storage-persister/src/index.ts b/packages/query-async-storage-persister/src/index.ts
index bc92f1141..cb477c49f 100644
--- a/packages/query-async-storage-persister/src/index.ts
+++ b/packages/query-async-storage-persister/src/index.ts
@@ -1,9 +1,9 @@
+import { asyncThrottle } from './asyncThrottle'
 import type {
   PersistedClient,
   Persister,
   Promisable,
 } from '@tanstack/query-persist-client-core'
-import { asyncThrottle } from './asyncThrottle'
 
 interface AsyncStorage {
   getItem: (key: string) => Promise<string | null>
diff --git a/packages/query-broadcast-client-experimental/package.json b/packages/query-broadcast-client-experimental/package.json
index 600d5f7c4..94def684e 100644
--- a/packages/query-broadcast-client-experimental/package.json
+++ b/packages/query-broadcast-client-experimental/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/query-broadcast-client-experimental",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "An experimental plugin to for broadcasting the state of your queryClient between browser tabs/windows",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/query-core/package.json b/packages/query-core/package.json
index 4dbd6f5ed..c51c98d60 100644
--- a/packages/query-core/package.json
+++ b/packages/query-core/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/query-core",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "The framework agnostic core that powers TanStack Query",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/query-core/src/focusManager.ts b/packages/query-core/src/focusManager.ts
index 710a009c7..f2d45e6a8 100644
--- a/packages/query-core/src/focusManager.ts
+++ b/packages/query-core/src/focusManager.ts
@@ -58,9 +58,9 @@ export class FocusManager extends Subscribable {
   }
 
   setFocused(focused?: boolean): void {
-    this.focused = focused
-
-    if (focused) {
+    const changed = this.focused !== focused
+    if (changed) {
+      this.focused = focused
       this.onFocus()
     }
   }
diff --git a/packages/query-core/src/infiniteQueryObserver.ts b/packages/query-core/src/infiniteQueryObserver.ts
index 921f5dc8d..832c79a26 100644
--- a/packages/query-core/src/infiniteQueryObserver.ts
+++ b/packages/query-core/src/infiniteQueryObserver.ts
@@ -1,3 +1,9 @@
+import { QueryObserver } from './queryObserver'
+import {
+  hasNextPage,
+  hasPreviousPage,
+  infiniteQueryBehavior,
+} from './infiniteQueryBehavior'
 import type {
   DefaultedInfiniteQueryObserverOptions,
   FetchNextPageOptions,
@@ -9,12 +15,6 @@ import type {
 } from './types'
 import type { QueryClient } from './queryClient'
 import type { NotifyOptions, ObserverFetchOptions } from './queryObserver'
-import { QueryObserver } from './queryObserver'
-import {
-  hasNextPage,
-  hasPreviousPage,
-  infiniteQueryBehavior,
-} from './infiniteQueryBehavior'
 import type { Query } from './query'
 
 type InfiniteQueryObserverListener<TData, TError> = (
diff --git a/packages/query-core/src/mutation.ts b/packages/query-core/src/mutation.ts
index fef628165..40ad641a5 100644
--- a/packages/query-core/src/mutation.ts
+++ b/packages/query-core/src/mutation.ts
@@ -1,12 +1,12 @@
-import type { MutationOptions, MutationStatus, MutationMeta } from './types'
-import type { MutationCache } from './mutationCache'
-import type { MutationObserver } from './mutationObserver'
-import type { Logger } from './logger'
 import { defaultLogger } from './logger'
 import { notifyManager } from './notifyManager'
 import { Removable } from './removable'
-import type { Retryer } from './retryer'
 import { canFetch, createRetryer } from './retryer'
+import type { MutationMeta, MutationOptions, MutationStatus } from './types'
+import type { MutationCache } from './mutationCache'
+import type { MutationObserver } from './mutationObserver'
+import type { Logger } from './logger'
+import type { Retryer } from './retryer'
 
 // TYPES
 
diff --git a/packages/query-core/src/mutationCache.ts b/packages/query-core/src/mutationCache.ts
index 4fc27c154..76658234b 100644
--- a/packages/query-core/src/mutationCache.ts
+++ b/packages/query-core/src/mutationCache.ts
@@ -1,12 +1,12 @@
+import { notifyManager } from './notifyManager'
+import { Mutation } from './mutation'
+import { matchMutation, noop } from './utils'
+import { Subscribable } from './subscribable'
 import type { MutationObserver } from './mutationObserver'
 import type { MutationOptions, NotifyEvent } from './types'
 import type { QueryClient } from './queryClient'
-import { notifyManager } from './notifyManager'
 import type { Action, MutationState } from './mutation'
-import { Mutation } from './mutation'
 import type { MutationFilters } from './utils'
-import { matchMutation, noop } from './utils'
-import { Subscribable } from './subscribable'
 
 // TYPES
 
diff --git a/packages/query-core/src/mutationObserver.ts b/packages/query-core/src/mutationObserver.ts
index e5431d703..5b0c0eba4 100644
--- a/packages/query-core/src/mutationObserver.ts
+++ b/packages/query-core/src/mutationObserver.ts
@@ -1,15 +1,15 @@
-import type { Action, Mutation } from './mutation'
 import { getDefaultState } from './mutation'
 import { notifyManager } from './notifyManager'
-import type { QueryClient } from './queryClient'
 import { Subscribable } from './subscribable'
+import { shallowEqualObjects } from './utils'
+import type { QueryClient } from './queryClient'
 import type {
   MutateOptions,
   MutationObserverBaseResult,
-  MutationObserverResult,
   MutationObserverOptions,
+  MutationObserverResult,
 } from './types'
-import { shallowEqualObjects } from './utils'
+import type { Action, Mutation } from './mutation'
 
 // TYPES
 
diff --git a/packages/query-core/src/onlineManager.ts b/packages/query-core/src/onlineManager.ts
index c42a948a0..f7049f40d 100644
--- a/packages/query-core/src/onlineManager.ts
+++ b/packages/query-core/src/onlineManager.ts
@@ -63,9 +63,10 @@ export class OnlineManager extends Subscribable {
   }
 
   setOnline(online?: boolean): void {
-    this.online = online
+    const changed = this.online !== online
 
-    if (online) {
+    if (changed) {
+      this.online = online
       this.onOnline()
     }
   }
diff --git a/packages/query-core/src/queriesObserver.ts b/packages/query-core/src/queriesObserver.ts
index 46c83e97d..8e07c4d9a 100644
--- a/packages/query-core/src/queriesObserver.ts
+++ b/packages/query-core/src/queriesObserver.ts
@@ -1,14 +1,14 @@
 import { difference, replaceAt } from './utils'
 import { notifyManager } from './notifyManager'
+import { QueryObserver } from './queryObserver'
+import { Subscribable } from './subscribable'
 import type {
+  DefaultedQueryObserverOptions,
   QueryObserverOptions,
   QueryObserverResult,
-  DefaultedQueryObserverOptions,
 } from './types'
 import type { QueryClient } from './queryClient'
 import type { NotifyOptions } from './queryObserver'
-import { QueryObserver } from './queryObserver'
-import { Subscribable } from './subscribable'
 
 type QueriesObserverListener = (result: QueryObserverResult[]) => void
 
diff --git a/packages/query-core/src/query.ts b/packages/query-core/src/query.ts
index 686d8af90..8b8b5ecab 100644
--- a/packages/query-core/src/query.ts
+++ b/packages/query-core/src/query.ts
@@ -1,23 +1,23 @@
 import { getAbortController, noop, replaceData, timeUntilStale } from './utils'
+import { defaultLogger } from './logger'
+import { notifyManager } from './notifyManager'
+import { canFetch, createRetryer, isCancelledError } from './retryer'
+import { Removable } from './removable'
 import type {
+  CancelOptions,
+  FetchStatus,
   InitialDataFunction,
+  QueryFunctionContext,
   QueryKey,
+  QueryMeta,
   QueryOptions,
   QueryStatus,
-  QueryFunctionContext,
-  QueryMeta,
-  CancelOptions,
   SetDataOptions,
-  FetchStatus,
 } from './types'
 import type { QueryCache } from './queryCache'
 import type { QueryObserver } from './queryObserver'
 import type { Logger } from './logger'
-import { defaultLogger } from './logger'
-import { notifyManager } from './notifyManager'
 import type { Retryer } from './retryer'
-import { isCancelledError, canFetch, createRetryer } from './retryer'
-import { Removable } from './removable'
 
 // TYPES
 
diff --git a/packages/query-core/src/queryCache.ts b/packages/query-core/src/queryCache.ts
index 8245d4d2c..91e66e278 100644
--- a/packages/query-core/src/queryCache.ts
+++ b/packages/query-core/src/queryCache.ts
@@ -1,11 +1,11 @@
-import type { QueryFilters } from './utils'
 import { hashQueryKeyByOptions, matchQuery, parseFilterArgs } from './utils'
-import type { Action, QueryState } from './query'
 import { Query } from './query'
-import type { NotifyEvent, QueryKey, QueryOptions } from './types'
 import { notifyManager } from './notifyManager'
-import type { QueryClient } from './queryClient'
 import { Subscribable } from './subscribable'
+import type { QueryFilters } from './utils'
+import type { Action, QueryState } from './query'
+import type { NotifyEvent, QueryKey, QueryOptions } from './types'
+import type { QueryClient } from './queryClient'
 import type { QueryObserver } from './queryObserver'
 
 // TYPES
diff --git a/packages/query-core/src/queryClient.ts b/packages/query-core/src/queryClient.ts
index 1df365a4e..cadc1fd0e 100644
--- a/packages/query-core/src/queryClient.ts
+++ b/packages/query-core/src/queryClient.ts
@@ -1,15 +1,23 @@
-import type { QueryFilters, Updater, MutationFilters } from './utils'
 import {
+  functionalUpdate,
   hashQueryKey,
+  hashQueryKeyByOptions,
   noop,
   parseFilterArgs,
   parseQueryArgs,
   partialMatchKey,
-  hashQueryKeyByOptions,
-  functionalUpdate,
 } from './utils'
+import { QueryCache } from './queryCache'
+import { MutationCache } from './mutationCache'
+import { focusManager } from './focusManager'
+import { onlineManager } from './onlineManager'
+import { notifyManager } from './notifyManager'
+import { infiniteQueryBehavior } from './infiniteQueryBehavior'
+import { defaultLogger } from './logger'
+import type { CancelOptions, DefaultedQueryObserverOptions } from './types'
+import type { Logger } from './logger'
+import type { QueryState } from './query'
 import type {
-  QueryClientConfig,
   DefaultOptions,
   FetchInfiniteQueryOptions,
   FetchQueryOptions,
@@ -19,6 +27,7 @@ import type {
   MutationKey,
   MutationObserverOptions,
   MutationOptions,
+  QueryClientConfig,
   QueryFunction,
   QueryKey,
   QueryObserverOptions,
@@ -30,16 +39,7 @@ import type {
   SetDataOptions,
   WithRequired,
 } from './types'
-import type { QueryState } from './query'
-import { QueryCache } from './queryCache'
-import { MutationCache } from './mutationCache'
-import { focusManager } from './focusManager'
-import { onlineManager } from './onlineManager'
-import { notifyManager } from './notifyManager'
-import { infiniteQueryBehavior } from './infiniteQueryBehavior'
-import type { CancelOptions, DefaultedQueryObserverOptions } from './types'
-import type { Logger } from './logger'
-import { defaultLogger } from './logger'
+import type { MutationFilters, QueryFilters, Updater } from './utils'
 
 // TYPES
 
diff --git a/packages/query-core/src/queryObserver.ts b/packages/query-core/src/queryObserver.ts
index 123996e57..7d6879529 100644
--- a/packages/query-core/src/queryObserver.ts
+++ b/packages/query-core/src/queryObserver.ts
@@ -1,4 +1,3 @@
-import type { DefaultedQueryObserverOptions, RefetchPageFilters } from './types'
 import {
   isServer,
   isValidTimeout,
@@ -8,6 +7,9 @@ import {
   timeUntilStale,
 } from './utils'
 import { notifyManager } from './notifyManager'
+import { focusManager } from './focusManager'
+import { Subscribable } from './subscribable'
+import { canFetch, isCancelledError } from './retryer'
 import type {
   PlaceholderDataFunction,
   QueryKey,
@@ -17,11 +19,9 @@ import type {
   QueryOptions,
   RefetchOptions,
 } from './types'
-import type { Query, QueryState, Action, FetchOptions } from './query'
+import type { Action, FetchOptions, Query, QueryState } from './query'
 import type { QueryClient } from './queryClient'
-import { focusManager } from './focusManager'
-import { Subscribable } from './subscribable'
-import { canFetch, isCancelledError } from './retryer'
+import type { DefaultedQueryObserverOptions, RefetchPageFilters } from './types'
 
 type QueryObserverListener<TData, TError> = (
   result: QueryObserverResult<TData, TError>,
@@ -240,7 +240,30 @@ export class QueryObserver<
   ): QueryObserverResult<TData, TError> {
     const query = this.client.getQueryCache().build(this.client, options)
 
-    return this.createResult(query, options)
+    const result = this.createResult(query, options)
+
+    if (shouldAssignObserverCurrentProperties(this, result, options)) {
+      // this assigns the optimistic result to the current Observer
+      // because if the query function changes, useQuery will be performing
+      // an effect where it would fetch again.
+      // When the fetch finishes, we perform a deep data cloning in order
+      // to reuse objects references. This deep data clone is performed against
+      // the `observer.currentResult.data` property
+      // When QueryKey changes, we refresh the query and get new `optimistic`
+      // result, while we leave the `observer.currentResult`, so when new data
+      // arrives, it finds the old `observer.currentResult` which is related
+      // to the old QueryKey. Which means that currentResult and selectData are
+      // out of sync already.
+      // To solve this, we move the cursor of the currentResult everytime
+      // an observer reads an optimistic value.
+
+      // When keeping the previous data, the result doesn't change until new
+      // data arrives.
+      this.currentResult = result
+      this.currentResultOptions = this.options
+      this.currentResultState = this.currentQuery.state
+    }
+    return result
   }
 
   getCurrentResult(): QueryObserverResult<TData, TError> {
@@ -764,3 +787,51 @@ function isStale(
 ): boolean {
   return query.isStaleByTime(options.staleTime)
 }
+
+// this function would decide if we will update the observer's 'current'
+// properties after an optimistic reading via getOptimisticResult
+function shouldAssignObserverCurrentProperties<
+  TQueryFnData = unknown,
+  TError = unknown,
+  TData = TQueryFnData,
+  TQueryData = TQueryFnData,
+  TQueryKey extends QueryKey = QueryKey,
+>(
+  observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,
+  optimisticResult: QueryObserverResult<TData, TError>,
+  options: DefaultedQueryObserverOptions<
+    TQueryFnData,
+    TError,
+    TData,
+    TQueryData,
+    TQueryKey
+  >,
+) {
+  // it is important to keep this condition like this for three reasons:
+  // 1. It will get removed in the v5
+  // 2. it reads: don't update the properties if we want to keep the previous
+  // data.
+  // 3. The opposite condition (!options.keepPreviousData) would fallthrough
+  // and will result in a bad decision
+  if (options.keepPreviousData) {
+    return false
+  }
+
+  // this means we want to put some placeholder data when pending and queryKey
+  // changed.
+  if (options.placeholderData !== undefined) {
+    // re-assign properties only if current data is placeholder data
+    // which means that data did not arrive yet, so, if there is some cached data
+    // we need to "prepare" to receive it
+    return optimisticResult.isPlaceholderData
+  }
+
+  // if the newly created result isn't what the observer is holding as current,
+  // then we'll need to update the properties as well
+  if (observer.getCurrentResult() !== optimisticResult) {
+    return true
+  }
+
+  // basically, just keep previous properties if nothing changed
+  return false
+}
diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts
index 95dedcda3..057cb40d6 100644
--- a/packages/query-core/src/types.ts
+++ b/packages/query-core/src/types.ts
@@ -1,8 +1,8 @@
 /* istanbul ignore file */
 
 import type { MutationState } from './mutation'
-import type { QueryBehavior, Query } from './query'
-import type { RetryValue, RetryDelayValue } from './retryer'
+import type { Query, QueryBehavior } from './query'
+import type { RetryDelayValue, RetryValue } from './retryer'
 import type { QueryFilters, QueryTypeFilter } from './utils'
 import type { QueryCache } from './queryCache'
 import type { MutationCache } from './mutationCache'
diff --git a/packages/query-persist-client-core/package.json b/packages/query-persist-client-core/package.json
index 12020fa5b..f5af54e44 100644
--- a/packages/query-persist-client-core/package.json
+++ b/packages/query-persist-client-core/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/query-persist-client-core",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "Set of utilities for interacting with persisters, which can save your queryClient for later use",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/query-persist-client-core/src/persist.ts b/packages/query-persist-client-core/src/persist.ts
index 9b4230404..409bb21fc 100644
--- a/packages/query-persist-client-core/src/persist.ts
+++ b/packages/query-persist-client-core/src/persist.ts
@@ -1,10 +1,10 @@
+import { dehydrate, hydrate } from '@tanstack/query-core'
 import type {
-  QueryClient,
-  DehydratedState,
   DehydrateOptions,
+  DehydratedState,
   HydrateOptions,
+  QueryClient,
 } from '@tanstack/query-core'
-import { dehydrate, hydrate } from '@tanstack/query-core'
 import type { NotifyEventType } from '@tanstack/query-core'
 
 export type Promisable<T> = T | PromiseLike<T>
diff --git a/packages/query-sync-storage-persister/package.json b/packages/query-sync-storage-persister/package.json
index 6df21ec06..1c4ad9639 100644
--- a/packages/query-sync-storage-persister/package.json
+++ b/packages/query-sync-storage-persister/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/query-sync-storage-persister",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "A persister for synchronous storages, to be used with TanStack/Query",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/query-sync-storage-persister/src/index.ts b/packages/query-sync-storage-persister/src/index.ts
index 095b50480..a97fefb32 100644
--- a/packages/query-sync-storage-persister/src/index.ts
+++ b/packages/query-sync-storage-persister/src/index.ts
@@ -1,7 +1,7 @@
 import type {
+  PersistRetryer,
   PersistedClient,
   Persister,
-  PersistRetryer,
 } from '@tanstack/query-persist-client-core'
 
 interface Storage {
diff --git a/packages/react-query-devtools/package.json b/packages/react-query-devtools/package.json
index 59c363110..0b5acf1a3 100644
--- a/packages/react-query-devtools/package.json
+++ b/packages/react-query-devtools/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/react-query-devtools",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "Developer tools to interact with and visualize the TanStack/react-query cache",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/react-query-devtools/src/Explorer.tsx b/packages/react-query-devtools/src/Explorer.tsx
index 5c40e5400..e08a589ce 100644
--- a/packages/react-query-devtools/src/Explorer.tsx
+++ b/packages/react-query-devtools/src/Explorer.tsx
@@ -1,8 +1,8 @@
 'use client'
 import * as React from 'react'
 
-import { displayValue, styled } from './utils'
 import superjson from 'superjson'
+import { displayValue, styled } from './utils'
 
 export const Entry = styled('div', {
   fontFamily: 'Menlo, monospace',
diff --git a/packages/react-query-devtools/src/devtools.tsx b/packages/react-query-devtools/src/devtools.tsx
index e0bb68ec1..5abee8a36 100644
--- a/packages/react-query-devtools/src/devtools.tsx
+++ b/packages/react-query-devtools/src/devtools.tsx
@@ -1,48 +1,48 @@
 'use client'
 import * as React from 'react'
-import { useSyncExternalStore } from './useSyncExternalStore'
-import type {
-  QueryCache,
-  QueryClient,
-  QueryKey as QueryKeyType,
-  ContextOptions,
-  Query,
-} from '@tanstack/react-query'
 import {
-  useQueryClient,
-  onlineManager,
   notifyManager,
+  onlineManager,
+  useQueryClient,
 } from '@tanstack/react-query'
 import { rankItem } from '@tanstack/match-sorter-utils'
+import { useMemo } from 'react'
+import { useSyncExternalStore } from './useSyncExternalStore'
 import useLocalStorage from './useLocalStorage'
 import {
+  defaultPanelSize,
+  displayValue,
+  getResizeHandleStyle,
+  getSidePanelStyle,
+  getSidedProp,
   isVerticalSide,
+  minPanelSize,
   sortFns,
   useIsMounted,
-  getSidePanelStyle,
-  minPanelSize,
-  getResizeHandleStyle,
-  getSidedProp,
-  defaultPanelSize,
-  displayValue,
 } from './utils'
-import type { Corner, Side } from './utils'
 import {
-  Panel,
-  QueryKeys,
-  QueryKey,
+  ActiveQueryPanel,
   Button,
   Code,
   Input,
+  Panel,
+  QueryKey,
+  QueryKeys,
   Select,
-  ActiveQueryPanel,
 } from './styledComponents'
 import ScreenReader from './screenreader'
 import { ThemeProvider, defaultTheme as theme } from './theme'
-import { getQueryStatusLabel, getQueryStatusColor } from './utils'
+import { getQueryStatusColor, getQueryStatusLabel } from './utils'
 import Explorer from './Explorer'
 import Logo from './Logo'
-import { useMemo } from 'react'
+import type { Corner, Side } from './utils'
+import type {
+  ContextOptions,
+  Query,
+  QueryCache,
+  QueryClient,
+  QueryKey as QueryKeyType,
+} from '@tanstack/react-query'
 
 export interface DevToolsErrorType {
   /**
diff --git a/packages/react-query-devtools/src/utils.ts b/packages/react-query-devtools/src/utils.ts
index 1bcad7598..25c8a6961 100644
--- a/packages/react-query-devtools/src/utils.ts
+++ b/packages/react-query-devtools/src/utils.ts
@@ -1,10 +1,10 @@
 import * as React from 'react'
-import type { Query } from '@tanstack/react-query'
 import SuperJSON from 'superjson'
 
-import type { Theme } from './theme'
 import { useTheme } from './theme'
 import useMediaQuery from './useMediaQuery'
+import type { Theme } from './theme'
+import type { Query } from '@tanstack/react-query'
 
 type StyledComponent<T> = T extends 'button'
   ? React.DetailedHTMLProps<
diff --git a/packages/react-query-persist-client/package.json b/packages/react-query-persist-client/package.json
index 6e47452df..9ed62f4eb 100644
--- a/packages/react-query-persist-client/package.json
+++ b/packages/react-query-persist-client/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/react-query-persist-client",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "React bindings to work with persisters in TanStack/react-query",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/react-query-persist-client/src/PersistQueryClientProvider.tsx b/packages/react-query-persist-client/src/PersistQueryClientProvider.tsx
index ecfc916a2..ac6ee4142 100644
--- a/packages/react-query-persist-client/src/PersistQueryClientProvider.tsx
+++ b/packages/react-query-persist-client/src/PersistQueryClientProvider.tsx
@@ -1,10 +1,10 @@
 'use client'
 import * as React from 'react'
 
-import type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'
 import { persistQueryClient } from '@tanstack/query-persist-client-core'
+import { IsRestoringProvider, QueryClientProvider } from '@tanstack/react-query'
+import type { PersistQueryClientOptions } from '@tanstack/query-persist-client-core'
 import type { QueryClientProviderProps } from '@tanstack/react-query'
-import { QueryClientProvider, IsRestoringProvider } from '@tanstack/react-query'
 
 export type PersistQueryClientProviderProps = QueryClientProviderProps & {
   persistOptions: Omit<PersistQueryClientOptions, 'queryClient'>
diff --git a/packages/react-query/package.json b/packages/react-query/package.json
index 178fd8073..2b32d9627 100644
--- a/packages/react-query/package.json
+++ b/packages/react-query/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/react-query",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "Hooks for managing, caching and syncing asynchronous and remote data in React",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/react-query/src/Hydrate.tsx b/packages/react-query/src/Hydrate.tsx
index 19d94a368..01bebe810 100644
--- a/packages/react-query/src/Hydrate.tsx
+++ b/packages/react-query/src/Hydrate.tsx
@@ -1,9 +1,9 @@
 'use client'
 import * as React from 'react'
 
-import type { HydrateOptions } from '@tanstack/query-core'
 import { hydrate } from '@tanstack/query-core'
 import { useQueryClient } from './QueryClientProvider'
+import type { HydrateOptions } from '@tanstack/query-core'
 import type { ContextOptions } from './types'
 
 export function useHydrate(
diff --git a/packages/react-query/src/errorBoundaryUtils.ts b/packages/react-query/src/errorBoundaryUtils.ts
index 68ed341bf..a50b7784a 100644
--- a/packages/react-query/src/errorBoundaryUtils.ts
+++ b/packages/react-query/src/errorBoundaryUtils.ts
@@ -1,4 +1,6 @@
 'use client'
+import * as React from 'react'
+import { shouldThrowError } from './utils'
 import type {
   DefaultedQueryObserverOptions,
   Query,
@@ -7,8 +9,6 @@ import type {
   UseErrorBoundary,
 } from '@tanstack/query-core'
 import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'
-import * as React from 'react'
-import { shouldThrowError } from './utils'
 
 export const ensurePreventErrorBoundaryRetry = <
   TQueryFnData,
diff --git a/packages/react-query/src/reactBatchedUpdates.native.ts b/packages/react-query/src/reactBatchedUpdates.native.ts
index 7ca91f79f..059b46f2a 100644
--- a/packages/react-query/src/reactBatchedUpdates.native.ts
+++ b/packages/react-query/src/reactBatchedUpdates.native.ts
@@ -1,4 +1,5 @@
 // @ts-ignore
 // eslint-disable-next-line import/no-unresolved
 import { unstable_batchedUpdates } from 'react-native'
+
 export { unstable_batchedUpdates }
diff --git a/packages/react-query/src/reactBatchedUpdates.ts b/packages/react-query/src/reactBatchedUpdates.ts
index 5cc191126..baffc0c24 100644
--- a/packages/react-query/src/reactBatchedUpdates.ts
+++ b/packages/react-query/src/reactBatchedUpdates.ts
@@ -1,3 +1,4 @@
 'use client'
 import * as ReactDOM from 'react-dom'
+
 export const unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates
diff --git a/packages/react-query/src/types.ts b/packages/react-query/src/types.ts
index 3525d3d72..648c0db85 100644
--- a/packages/react-query/src/types.ts
+++ b/packages/react-query/src/types.ts
@@ -2,15 +2,15 @@
 
 import type * as React from 'react'
 import type {
+  DefinedQueryObserverResult,
   InfiniteQueryObserverOptions,
   InfiniteQueryObserverResult,
+  MutateFunction,
+  MutationObserverOptions,
   MutationObserverResult,
+  QueryKey,
   QueryObserverOptions,
   QueryObserverResult,
-  QueryKey,
-  MutationObserverOptions,
-  MutateFunction,
-  DefinedQueryObserverResult,
 } from '@tanstack/query-core'
 import type { QueryClient } from '@tanstack/query-core'
 
diff --git a/packages/react-query/src/useBaseQuery.ts b/packages/react-query/src/useBaseQuery.ts
index 87d3ff5ec..834103f09 100644
--- a/packages/react-query/src/useBaseQuery.ts
+++ b/packages/react-query/src/useBaseQuery.ts
@@ -1,19 +1,19 @@
 'use client'
 import * as React from 'react'
-import { useSyncExternalStore } from './useSyncExternalStore'
 
-import type { QueryKey, QueryObserver } from '@tanstack/query-core'
 import { notifyManager } from '@tanstack/query-core'
+import { useSyncExternalStore } from './useSyncExternalStore'
 import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
 import { useQueryClient } from './QueryClientProvider'
-import type { UseBaseQueryOptions } from './types'
 import { useIsRestoring } from './isRestoring'
 import {
   ensurePreventErrorBoundaryRetry,
   getHasError,
   useClearResetErrorBoundary,
 } from './errorBoundaryUtils'
-import { ensureStaleTime, shouldSuspend, fetchOptimistic } from './suspense'
+import { ensureStaleTime, fetchOptimistic, shouldSuspend } from './suspense'
+import type { QueryKey, QueryObserver } from '@tanstack/query-core'
+import type { UseBaseQueryOptions } from './types'
 
 export function useBaseQuery<
   TQueryFnData,
diff --git a/packages/react-query/src/useInfiniteQuery.ts b/packages/react-query/src/useInfiniteQuery.ts
index 85e78699b..cffc36f0d 100644
--- a/packages/react-query/src/useInfiniteQuery.ts
+++ b/packages/react-query/src/useInfiniteQuery.ts
@@ -1,12 +1,12 @@
 'use client'
+import { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'
+import { useBaseQuery } from './useBaseQuery'
 import type {
-  QueryObserver,
   QueryFunction,
   QueryKey,
+  QueryObserver,
 } from '@tanstack/query-core'
-import { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'
 import type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'
-import { useBaseQuery } from './useBaseQuery'
 
 // HOOK
 
diff --git a/packages/react-query/src/useIsFetching.ts b/packages/react-query/src/useIsFetching.ts
index ceac65749..e54fdcb2e 100644
--- a/packages/react-query/src/useIsFetching.ts
+++ b/packages/react-query/src/useIsFetching.ts
@@ -1,11 +1,11 @@
 'use client'
 import * as React from 'react'
-import type { QueryKey, QueryFilters } from '@tanstack/query-core'
 import { notifyManager, parseFilterArgs } from '@tanstack/query-core'
 
 import { useSyncExternalStore } from './useSyncExternalStore'
-import type { ContextOptions } from './types'
 import { useQueryClient } from './QueryClientProvider'
+import type { ContextOptions } from './types'
+import type { QueryFilters, QueryKey } from '@tanstack/query-core'
 
 interface Options extends ContextOptions {}
 
diff --git a/packages/react-query/src/useIsMutating.ts b/packages/react-query/src/useIsMutating.ts
index 97c3ad2e4..e20b0ec72 100644
--- a/packages/react-query/src/useIsMutating.ts
+++ b/packages/react-query/src/useIsMutating.ts
@@ -1,11 +1,11 @@
 'use client'
 import * as React from 'react'
+import { notifyManager, parseMutationFilterArgs } from '@tanstack/query-core'
 import { useSyncExternalStore } from './useSyncExternalStore'
 
-import type { MutationKey, MutationFilters } from '@tanstack/query-core'
-import { notifyManager, parseMutationFilterArgs } from '@tanstack/query-core'
-import type { ContextOptions } from './types'
 import { useQueryClient } from './QueryClientProvider'
+import type { MutationFilters, MutationKey } from '@tanstack/query-core'
+import type { ContextOptions } from './types'
 
 interface Options extends ContextOptions {}
 
diff --git a/packages/react-query/src/useMutation.ts b/packages/react-query/src/useMutation.ts
index 0f10dbf74..c841d9346 100644
--- a/packages/react-query/src/useMutation.ts
+++ b/packages/react-query/src/useMutation.ts
@@ -1,20 +1,20 @@
 'use client'
 import * as React from 'react'
-import { useSyncExternalStore } from './useSyncExternalStore'
-
-import type { MutationFunction, MutationKey } from '@tanstack/query-core'
 import {
+  MutationObserver,
   notifyManager,
   parseMutationArgs,
-  MutationObserver,
 } from '@tanstack/query-core'
+import { useSyncExternalStore } from './useSyncExternalStore'
+
 import { useQueryClient } from './QueryClientProvider'
+import { shouldThrowError } from './utils'
+import type { MutationFunction, MutationKey } from '@tanstack/query-core'
 import type {
   UseMutateFunction,
   UseMutationOptions,
   UseMutationResult,
 } from './types'
-import { shouldThrowError } from './utils'
 
 // HOOK
 
diff --git a/packages/react-query/src/useQueries.ts b/packages/react-query/src/useQueries.ts
index 46d4c3e5e..f867627c8 100644
--- a/packages/react-query/src/useQueries.ts
+++ b/packages/react-query/src/useQueries.ts
@@ -1,11 +1,9 @@
 'use client'
 import * as React from 'react'
-import { useSyncExternalStore } from './useSyncExternalStore'
 
-import type { QueryKey, QueryFunction } from '@tanstack/query-core'
-import { notifyManager, QueriesObserver } from '@tanstack/query-core'
+import { QueriesObserver, notifyManager } from '@tanstack/query-core'
+import { useSyncExternalStore } from './useSyncExternalStore'
 import { useQueryClient } from './QueryClientProvider'
-import type { UseQueryOptions, UseQueryResult } from './types'
 import { useIsRestoring } from './isRestoring'
 import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
 import {
@@ -15,10 +13,12 @@ import {
 } from './errorBoundaryUtils'
 import {
   ensureStaleTime,
-  shouldSuspend,
   fetchOptimistic,
+  shouldSuspend,
   willFetch,
 } from './suspense'
+import type { QueryFunction, QueryKey } from '@tanstack/query-core'
+import type { UseQueryOptions, UseQueryResult } from './types'
 
 // This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
 // - `context` is omitted as it is passed as a root-level option to `useQueries` instead.
diff --git a/packages/react-query/src/useQuery.ts b/packages/react-query/src/useQuery.ts
index ae23e9016..c6ec05abc 100644
--- a/packages/react-query/src/useQuery.ts
+++ b/packages/react-query/src/useQuery.ts
@@ -1,12 +1,12 @@
 'use client'
+import { QueryObserver, parseQueryArgs } from '@tanstack/query-core'
+import { useBaseQuery } from './useBaseQuery'
 import type { QueryFunction, QueryKey } from '@tanstack/query-core'
-import { parseQueryArgs, QueryObserver } from '@tanstack/query-core'
 import type {
   DefinedUseQueryResult,
   UseQueryOptions,
   UseQueryResult,
 } from './types'
-import { useBaseQuery } from './useBaseQuery'
 
 // HOOK
 
diff --git a/packages/solid-query/package.json b/packages/solid-query/package.json
index baab8b363..3d3ed8313 100644
--- a/packages/solid-query/package.json
+++ b/packages/solid-query/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/solid-query",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
   "author": "tannerlinsley",
   "license": "MIT",
diff --git a/packages/solid-query/src/QueryClientProvider.tsx b/packages/solid-query/src/QueryClientProvider.tsx
index 48688fe97..396835ab3 100644
--- a/packages/solid-query/src/QueryClientProvider.tsx
+++ b/packages/solid-query/src/QueryClientProvider.tsx
@@ -1,12 +1,12 @@
-import type { QueryClient } from '@tanstack/query-core'
-import type { Context, JSX } from 'solid-js'
 import {
   createContext,
-  useContext,
-  onMount,
-  onCleanup,
   mergeProps,
+  onCleanup,
+  onMount,
+  useContext,
 } from 'solid-js'
+import type { QueryClient } from '@tanstack/query-core'
+import type { Context, JSX } from 'solid-js'
 import type { ContextOptions } from './types'
 
 declare global {
diff --git a/packages/solid-query/src/createBaseQuery.ts b/packages/solid-query/src/createBaseQuery.ts
index 209c70532..d73c0b57e 100644
--- a/packages/solid-query/src/createBaseQuery.ts
+++ b/packages/solid-query/src/createBaseQuery.ts
@@ -1,17 +1,17 @@
-import type { QueryObserver } from '@tanstack/query-core'
-import type { QueryKey, QueryObserverResult } from '@tanstack/query-core'
-import type { CreateBaseQueryOptions } from './types'
-import { useQueryClient } from './QueryClientProvider'
 import {
-  onMount,
-  onCleanup,
+  batch,
   createComputed,
   createResource,
   on,
-  batch,
+  onCleanup,
+  onMount,
 } from 'solid-js'
 import { createStore, unwrap } from 'solid-js/store'
+import { useQueryClient } from './QueryClientProvider'
 import { shouldThrowError } from './utils'
+import type { QueryObserver } from '@tanstack/query-core'
+import type { QueryKey, QueryObserverResult } from '@tanstack/query-core'
+import type { CreateBaseQueryOptions } from './types'
 
 // Base Query Function that is used to create the query.
 export function createBaseQuery<
diff --git a/packages/solid-query/src/createInfiniteQuery.ts b/packages/solid-query/src/createInfiniteQuery.ts
index fbef03ea6..585262918 100644
--- a/packages/solid-query/src/createInfiniteQuery.ts
+++ b/packages/solid-query/src/createInfiniteQuery.ts
@@ -1,18 +1,18 @@
-import type {
-  QueryObserver,
-  QueryFunction,
-  QueryOptions,
-} from '@tanstack/query-core'
 import { InfiniteQueryObserver } from '@tanstack/query-core'
+import { createComputed } from 'solid-js'
+import { createStore } from 'solid-js/store'
+import { createBaseQuery } from './createBaseQuery'
+import { parseQueryArgs } from './utils'
 import type {
   CreateInfiniteQueryOptions,
   CreateInfiniteQueryResult,
   SolidQueryKey,
 } from './types'
-import { createBaseQuery } from './createBaseQuery'
-import { createComputed } from 'solid-js'
-import { createStore } from 'solid-js/store'
-import { parseQueryArgs } from './utils'
+import type {
+  QueryFunction,
+  QueryObserver,
+  QueryOptions,
+} from '@tanstack/query-core'
 
 export function createInfiniteQuery<
   TQueryFnData = unknown,
diff --git a/packages/solid-query/src/createMutation.ts b/packages/solid-query/src/createMutation.ts
index 2ecb4ad34..c0aa65bc1 100644
--- a/packages/solid-query/src/createMutation.ts
+++ b/packages/solid-query/src/createMutation.ts
@@ -1,14 +1,14 @@
-import type { MutationFunction, MutationKey } from '@tanstack/query-core'
-import { parseMutationArgs, MutationObserver } from '@tanstack/query-core'
+import { MutationObserver, parseMutationArgs } from '@tanstack/query-core'
+import { createComputed, on, onCleanup } from 'solid-js'
+import { createStore } from 'solid-js/store'
 import { useQueryClient } from './QueryClientProvider'
+import { shouldThrowError } from './utils'
 import type {
   CreateMutateFunction,
   CreateMutationOptions,
   CreateMutationResult,
 } from './types'
-import { createComputed, onCleanup, on } from 'solid-js'
-import { createStore } from 'solid-js/store'
-import { shouldThrowError } from './utils'
+import type { MutationFunction, MutationKey } from '@tanstack/query-core'
 
 // HOOK
 export function createMutation<
diff --git a/packages/solid-query/src/createQueries.ts b/packages/solid-query/src/createQueries.ts
index 1fc449641..d8f466720 100644
--- a/packages/solid-query/src/createQueries.ts
+++ b/packages/solid-query/src/createQueries.ts
@@ -1,14 +1,14 @@
 import { createComputed, onCleanup, onMount } from 'solid-js'
-import type { QueryFunction } from '@tanstack/query-core'
 import { QueriesObserver } from '@tanstack/query-core'
+import { createStore, unwrap } from 'solid-js/store'
 import { useQueryClient } from './QueryClientProvider'
+import { scheduleMicrotask } from './utils'
 import type {
   CreateQueryOptions,
   CreateQueryResult,
   SolidQueryKey,
 } from './types'
-import { createStore, unwrap } from 'solid-js/store'
-import { scheduleMicrotask } from './utils'
+import type { QueryFunction } from '@tanstack/query-core'
 
 // This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
 // - `context` is omitted as it is passed as a root-level option to `useQueries` instead.
diff --git a/packages/solid-query/src/createQuery.ts b/packages/solid-query/src/createQuery.ts
index 387c63a54..e2fbc1c45 100644
--- a/packages/solid-query/src/createQuery.ts
+++ b/packages/solid-query/src/createQuery.ts
@@ -1,15 +1,15 @@
-import type { QueryFunction, QueryOptions } from '@tanstack/query-core'
 import { QueryObserver } from '@tanstack/query-core'
+import { createComputed } from 'solid-js'
+import { createStore } from 'solid-js/store'
+import { parseQueryArgs } from './utils'
+import { createBaseQuery } from './createBaseQuery'
 import type {
   CreateQueryOptions,
   CreateQueryResult,
   DefinedCreateQueryResult,
   SolidQueryKey,
 } from './types'
-import { createComputed } from 'solid-js'
-import { createStore } from 'solid-js/store'
-import { parseQueryArgs } from './utils'
-import { createBaseQuery } from './createBaseQuery'
+import type { QueryFunction, QueryOptions } from '@tanstack/query-core'
 
 // There are several ways to create a query.
 // 1. createQuery(options: CreateQueryOptions)
diff --git a/packages/solid-query/src/types.ts b/packages/solid-query/src/types.ts
index 817c599e8..ae88516c3 100644
--- a/packages/solid-query/src/types.ts
+++ b/packages/solid-query/src/types.ts
@@ -2,17 +2,17 @@
 
 import type { Context } from 'solid-js'
 import type {
-  QueryClient,
-  QueryKey,
-  QueryObserverOptions,
-  QueryObserverResult,
-  MutateFunction,
-  MutationObserverOptions,
-  MutationObserverResult,
   DefinedQueryObserverResult,
   InfiniteQueryObserverOptions,
   InfiniteQueryObserverResult,
+  MutateFunction,
+  MutationObserverOptions,
+  MutationObserverResult,
+  QueryClient,
   QueryFilters,
+  QueryKey,
+  QueryObserverOptions,
+  QueryObserverResult,
   QueryOptions,
 } from '@tanstack/query-core'
 
diff --git a/packages/solid-query/src/useIsFetching.ts b/packages/solid-query/src/useIsFetching.ts
index 06844a379..6944f736a 100644
--- a/packages/solid-query/src/useIsFetching.ts
+++ b/packages/solid-query/src/useIsFetching.ts
@@ -1,10 +1,10 @@
+import { createComputed, createMemo, createSignal, onCleanup } from 'solid-js'
+import { useQueryClient } from './QueryClientProvider'
+import { parseFilterArgs } from './utils'
 import type { QueryFilters } from '@tanstack/query-core'
 
-import type { ContextOptions, SolidQueryKey, SolidQueryFilters } from './types'
-import { useQueryClient } from './QueryClientProvider'
+import type { ContextOptions, SolidQueryFilters, SolidQueryKey } from './types'
 import type { Accessor } from 'solid-js'
-import { createSignal, onCleanup, createComputed, createMemo } from 'solid-js'
-import { parseFilterArgs } from './utils'
 
 interface Options extends ContextOptions {}
 
diff --git a/packages/solid-query/src/useIsMutating.ts b/packages/solid-query/src/useIsMutating.ts
index 5fe0bc91c..e4f80aac7 100644
--- a/packages/solid-query/src/useIsMutating.ts
+++ b/packages/solid-query/src/useIsMutating.ts
@@ -1,9 +1,9 @@
-import type { MutationKey, MutationFilters } from '@tanstack/query-core'
 import { parseMutationFilterArgs } from '@tanstack/query-core'
-import type { ContextOptions } from './types'
+import { createSignal, onCleanup } from 'solid-js'
 import { useQueryClient } from './QueryClientProvider'
+import type { MutationFilters, MutationKey } from '@tanstack/query-core'
+import type { ContextOptions } from './types'
 import type { Accessor } from 'solid-js'
-import { createSignal, onCleanup } from 'solid-js'
 
 interface Options extends ContextOptions {}
 
diff --git a/packages/solid-query/src/utils.ts b/packages/solid-query/src/utils.ts
index 6e418e591..a0882419b 100644
--- a/packages/solid-query/src/utils.ts
+++ b/packages/solid-query/src/utils.ts
@@ -1,8 +1,8 @@
 import type {
-  SolidQueryKey,
-  SolidQueryFilters,
   ParseFilterArgs,
   ParseQueryArgs,
+  SolidQueryFilters,
+  SolidQueryKey,
 } from './types'
 import type { QueryFunction, QueryOptions } from '@tanstack/query-core'
 
diff --git a/packages/svelte-query/package.json b/packages/svelte-query/package.json
index a7e93518b..4aed81f09 100644
--- a/packages/svelte-query/package.json
+++ b/packages/svelte-query/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/svelte-query",
-  "version": "4.29.19",
+  "version": "4.29.25",
   "description": "Primitives for managing, caching and syncing asynchronous and remote data in Svelte",
   "author": "Lachlan Collins",
   "license": "MIT",
@@ -55,6 +55,6 @@
     "@tanstack/query-core": "workspace:*"
   },
   "peerDependencies": {
-    "svelte": "^3.54.0"
+    "svelte": ">=3 <5"
   }
 }
diff --git a/packages/svelte-query/src/Hydrate.svelte b/packages/svelte-query/src/Hydrate.svelte
index de3e6ca7c..1790154d7 100644
--- a/packages/svelte-query/src/Hydrate.svelte
+++ b/packages/svelte-query/src/Hydrate.svelte
@@ -1,6 +1,6 @@
 <script lang="ts">
-  import type { DehydratedState, HydrateOptions } from '@tanstack/query-core'
   import { useHydrate } from './useHydrate'
+  import type { DehydratedState, HydrateOptions } from '@tanstack/query-core'
 
   export let state: DehydratedState
   export let options: HydrateOptions | undefined = undefined
diff --git a/packages/svelte-query/src/QueryClientProvider.svelte b/packages/svelte-query/src/QueryClientProvider.svelte
index 86ce96ece..938562a14 100644
--- a/packages/svelte-query/src/QueryClientProvider.svelte
+++ b/packages/svelte-query/src/QueryClientProvider.svelte
@@ -1,5 +1,5 @@
 <script lang="ts">
-  import { onMount, onDestroy } from 'svelte'
+  import { onDestroy, onMount } from 'svelte'
   import { QueryClient } from '@tanstack/query-core'
   import { setQueryClientContext } from './context'
 
diff --git a/packages/svelte-query/src/context.ts b/packages/svelte-query/src/context.ts
index d907da473..99cca475d 100644
--- a/packages/svelte-query/src/context.ts
+++ b/packages/svelte-query/src/context.ts
@@ -1,4 +1,4 @@
-import { setContext, getContext } from 'svelte'
+import { getContext, setContext } from 'svelte'
 import type { QueryClient } from '@tanstack/query-core'
 
 const _contextKey = '$$_queryClient'
diff --git a/packages/svelte-query/src/createBaseQuery.ts b/packages/svelte-query/src/createBaseQuery.ts
index 401dfc51e..3dbc904eb 100644
--- a/packages/svelte-query/src/createBaseQuery.ts
+++ b/packages/svelte-query/src/createBaseQuery.ts
@@ -1,11 +1,11 @@
 import {
-  notifyManager,
   type QueryKey,
   type QueryObserver,
+  notifyManager,
 } from '@tanstack/query-core'
-import type { CreateBaseQueryOptions, CreateBaseQueryResult } from './types'
-import { useQueryClient } from './useQueryClient'
 import { derived, readable } from 'svelte/store'
+import { useQueryClient } from './useQueryClient'
+import type { CreateBaseQueryOptions, CreateBaseQueryResult } from './types'
 
 export function createBaseQuery<
   TQueryFnData,
diff --git a/packages/svelte-query/src/createInfiniteQuery.ts b/packages/svelte-query/src/createInfiniteQuery.ts
index 83683769b..b31aae9ef 100644
--- a/packages/svelte-query/src/createInfiniteQuery.ts
+++ b/packages/svelte-query/src/createInfiniteQuery.ts
@@ -1,15 +1,15 @@
 import {
   InfiniteQueryObserver,
-  parseQueryArgs,
-  type QueryObserver,
   type QueryFunction,
   type QueryKey,
+  type QueryObserver,
+  parseQueryArgs,
 } from '@tanstack/query-core'
+import { createBaseQuery } from './createBaseQuery'
 import type {
   CreateInfiniteQueryOptions,
   CreateInfiniteQueryResult,
 } from './types'
-import { createBaseQuery } from './createBaseQuery'
 
 export function createInfiniteQuery<
   TQueryFnData = unknown,
diff --git a/packages/svelte-query/src/createMutation.ts b/packages/svelte-query/src/createMutation.ts
index c0b2b9580..2cde6d99a 100644
--- a/packages/svelte-query/src/createMutation.ts
+++ b/packages/svelte-query/src/createMutation.ts
@@ -1,4 +1,4 @@
-import { readable, derived } from 'svelte/store'
+import { derived, readable } from 'svelte/store'
 import {
   type MutationFunction,
   type MutationKey,
@@ -6,12 +6,12 @@ import {
   notifyManager,
   parseMutationArgs,
 } from '@tanstack/query-core'
+import { useQueryClient } from './useQueryClient'
 import type {
   CreateMutateFunction,
   CreateMutationOptions,
   CreateMutationResult,
 } from './types'
-import { useQueryClient } from './useQueryClient'
 
 export function createMutation<
   TData = unknown,
diff --git a/packages/svelte-query/src/createQueries.ts b/packages/svelte-query/src/createQueries.ts
index 2fdc9a5d5..234a5c739 100644
--- a/packages/svelte-query/src/createQueries.ts
+++ b/packages/svelte-query/src/createQueries.ts
@@ -1,16 +1,15 @@
+import { QueriesObserver, notifyManager } from '@tanstack/query-core'
+import { type Readable, readable } from 'svelte/store'
+
+import { useQueryClient } from './useQueryClient'
+import type { CreateQueryOptions } from './types'
 import type {
-  QueryKey,
-  QueryFunction,
   QueryClient,
+  QueryFunction,
+  QueryKey,
   QueryObserverResult,
 } from '@tanstack/query-core'
 
-import { notifyManager, QueriesObserver } from '@tanstack/query-core'
-import { readable, type Readable } from 'svelte/store'
-
-import type { CreateQueryOptions } from './types'
-import { useQueryClient } from './useQueryClient'
-
 // This defines the `CreateQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
 // - `context` is omitted as it is passed as a root-level option to `createQueries` instead.
 type CreateQueryOptionsForCreateQueries<
diff --git a/packages/svelte-query/src/createQuery.ts b/packages/svelte-query/src/createQuery.ts
index da26283b2..d83614bc8 100644
--- a/packages/svelte-query/src/createQuery.ts
+++ b/packages/svelte-query/src/createQuery.ts
@@ -1,10 +1,10 @@
 import { QueryObserver, parseQueryArgs } from '@tanstack/query-core'
-import type { QueryFunction, QueryKey } from '@tanstack/query-core'
 import { createBaseQuery } from './createBaseQuery'
+import type { QueryFunction, QueryKey } from '@tanstack/query-core'
 import type {
-  DefinedCreateQueryResult,
   CreateQueryOptions,
   CreateQueryResult,
+  DefinedCreateQueryResult,
 } from './types'
 
 export function createQuery<
diff --git a/packages/svelte-query/src/types.ts b/packages/svelte-query/src/types.ts
index 853f6c464..6df79cb23 100644
--- a/packages/svelte-query/src/types.ts
+++ b/packages/svelte-query/src/types.ts
@@ -1,13 +1,13 @@
 import type {
+  DefinedQueryObserverResult,
   InfiniteQueryObserverOptions,
   InfiniteQueryObserverResult,
+  MutateFunction,
+  MutationObserverOptions,
   MutationObserverResult,
+  QueryKey,
   QueryObserverOptions,
   QueryObserverResult,
-  QueryKey,
-  MutationObserverOptions,
-  MutateFunction,
-  DefinedQueryObserverResult,
 } from '@tanstack/query-core'
 import type { QueryClient } from '@tanstack/query-core'
 import type { Readable } from 'svelte/store'
diff --git a/packages/svelte-query/src/useIsFetching.ts b/packages/svelte-query/src/useIsFetching.ts
index e0f8aea5e..535e72ab5 100644
--- a/packages/svelte-query/src/useIsFetching.ts
+++ b/packages/svelte-query/src/useIsFetching.ts
@@ -1,9 +1,9 @@
 import {
+  type QueryClient,
   type QueryFilters,
   type QueryKey,
-  type QueryClient,
-  parseFilterArgs,
   notifyManager,
+  parseFilterArgs,
 } from '@tanstack/query-core'
 import { type Readable, readable } from 'svelte/store'
 import { useQueryClient } from './useQueryClient'
diff --git a/packages/svelte-query/src/useQueryClient.ts b/packages/svelte-query/src/useQueryClient.ts
index ed725c892..c07cb6263 100644
--- a/packages/svelte-query/src/useQueryClient.ts
+++ b/packages/svelte-query/src/useQueryClient.ts
@@ -1,5 +1,5 @@
-import type { QueryClient } from '@tanstack/query-core'
 import { getQueryClientContext } from './context'
+import type { QueryClient } from '@tanstack/query-core'
 
 export function useQueryClient(): QueryClient {
   const queryClient = getQueryClientContext()
diff --git a/packages/svelte-query/vite.config.ts b/packages/svelte-query/vite.config.ts
index 67731c949..2f66b2262 100644
--- a/packages/svelte-query/vite.config.ts
+++ b/packages/svelte-query/vite.config.ts
@@ -1,8 +1,8 @@
 import { svelte } from '@sveltejs/vite-plugin-svelte'
-import path from 'path'
-import type { UserConfig } from 'vite'
+import { defineConfig } from 'vitest/config'
+import path from 'node:path'
 
-const config: UserConfig = {
+export default defineConfig({
   plugins: [svelte()],
   resolve: {
     alias: {
@@ -22,6 +22,4 @@ const config: UserConfig = {
     include: ['src/**/*.{test,spec}.{js,ts}'],
     setupFiles: ['vitest.setup.ts'],
   },
-}
-
-export default config
+})
diff --git a/packages/vue-query/package.json b/packages/vue-query/package.json
index 05f9ecfee..327b0cd39 100644
--- a/packages/vue-query/package.json
+++ b/packages/vue-query/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/vue-query",
-  "version": "4.29.20",
+  "version": "4.29.25",
   "description": "Hooks for managing, caching and syncing asynchronous and remote data in Vue",
   "author": "Damian Osipiuk",
   "license": "MIT",
diff --git a/packages/vue-query/src/devtools/devtools.ts b/packages/vue-query/src/devtools/devtools.ts
index 4b59a5827..e9425d279 100644
--- a/packages/vue-query/src/devtools/devtools.ts
+++ b/packages/vue-query/src/devtools/devtools.ts
@@ -1,16 +1,16 @@
 /* istanbul ignore file */
 
 import { setupDevtoolsPlugin } from '@vue/devtools-api'
-import type { CustomInspectorNode } from '@vue/devtools-api'
 import { rankItem } from '@tanstack/match-sorter-utils'
-import type { Query } from '@tanstack/query-core'
-import type { QueryClient } from '../queryClient'
 import {
   getQueryStateLabel,
   getQueryStatusBg,
   getQueryStatusFg,
   sortFns,
 } from './utils'
+import type { CustomInspectorNode } from '@vue/devtools-api'
+import type { Query, QueryCacheNotifyEvent } from '@tanstack/query-core'
+import type { QueryClient } from '../queryClient'
 
 const pluginId = 'vue-query'
 const pluginName = 'Vue Query'
@@ -103,10 +103,15 @@ export function setupDevtools(app: any, queryClient: QueryClient) {
         api.sendInspectorTree(pluginId)
         api.sendInspectorState(pluginId)
 
+        const queryEvents: QueryCacheNotifyEvent['type'][] = [
+          'added',
+          'removed',
+          'updated',
+        ]
         if (
           // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
           event &&
-          ['queryAdded', 'queryRemoved', 'queryUpdated'].includes(event.type)
+          queryEvents.includes(event.type)
         ) {
           api.addTimelineEvent({
             layerId: pluginId,
diff --git a/packages/vue-query/src/mutationCache.ts b/packages/vue-query/src/mutationCache.ts
index d12edd522..6c60a879b 100644
--- a/packages/vue-query/src/mutationCache.ts
+++ b/packages/vue-query/src/mutationCache.ts
@@ -1,7 +1,7 @@
 import { MutationCache as MC } from '@tanstack/query-core'
+import { cloneDeepUnref } from './utils'
 import type { Mutation, MutationFilters } from '@tanstack/query-core'
 import type { MaybeRefDeep } from './types'
-import { cloneDeepUnref } from './utils'
 
 export class MutationCache extends MC {
   find<TData = unknown, TError = unknown, TVariables = any, TContext = unknown>(
diff --git a/packages/vue-query/src/queryCache.ts b/packages/vue-query/src/queryCache.ts
index 04cfaad86..1ecfa5190 100644
--- a/packages/vue-query/src/queryCache.ts
+++ b/packages/vue-query/src/queryCache.ts
@@ -1,7 +1,7 @@
 import { QueryCache as QC } from '@tanstack/query-core'
-import type { Query, QueryKey, QueryFilters } from '@tanstack/query-core'
-import type { MaybeRefDeep } from './types'
 import { cloneDeepUnref, isQueryKey } from './utils'
+import type { Query, QueryFilters, QueryKey } from '@tanstack/query-core'
+import type { MaybeRefDeep } from './types'
 
 export class QueryCache extends QC {
   find<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData>(
diff --git a/packages/vue-query/src/queryClient.ts b/packages/vue-query/src/queryClient.ts
index 91f7b9c3e..efaf89bff 100644
--- a/packages/vue-query/src/queryClient.ts
+++ b/packages/vue-query/src/queryClient.ts
@@ -1,33 +1,33 @@
 import { ref } from 'vue-demi'
 import { QueryClient as QC } from '@tanstack/query-core'
+import { cloneDeepUnref, isQueryKey } from './utils'
+import { QueryCache } from './queryCache'
+import { MutationCache } from './mutationCache'
+import type { MaybeRefDeep } from './types'
 import type {
-  QueryKey,
-  QueryClientConfig,
-  SetDataOptions,
-  ResetQueryFilters,
-  ResetOptions,
   CancelOptions,
-  InvalidateQueryFilters,
-  InvalidateOptions,
-  RefetchQueryFilters,
-  RefetchOptions,
-  FetchQueryOptions,
-  QueryFunction,
+  DefaultOptions,
   FetchInfiniteQueryOptions,
+  FetchQueryOptions,
   InfiniteData,
-  DefaultOptions,
-  QueryObserverOptions,
+  InvalidateOptions,
+  InvalidateQueryFilters,
+  MutationFilters,
   MutationKey,
   MutationObserverOptions,
+  QueryClientConfig,
   QueryFilters,
-  MutationFilters,
+  QueryFunction,
+  QueryKey,
+  QueryObserverOptions,
   QueryState,
+  RefetchOptions,
+  RefetchQueryFilters,
+  ResetOptions,
+  ResetQueryFilters,
+  SetDataOptions,
   Updater,
 } from '@tanstack/query-core'
-import type { MaybeRefDeep } from './types'
-import { cloneDeepUnref, isQueryKey } from './utils'
-import { QueryCache } from './queryCache'
-import { MutationCache } from './mutationCache'
 
 export class QueryClient extends QC {
   constructor(config: MaybeRefDeep<QueryClientConfig> = {}) {
diff --git a/packages/vue-query/src/types.ts b/packages/vue-query/src/types.ts
index 9c0e0d473..e0429b2c1 100644
--- a/packages/vue-query/src/types.ts
+++ b/packages/vue-query/src/types.ts
@@ -1,9 +1,9 @@
 /* istanbul ignore file */
 
 import type {
+  InfiniteQueryObserverOptions,
   QueryKey,
   QueryObserverOptions,
-  InfiniteQueryObserverOptions,
 } from '@tanstack/query-core'
 import type { Ref, UnwrapRef } from 'vue-demi'
 import type { QueryClient } from './queryClient'
diff --git a/packages/vue-query/src/useBaseQuery.ts b/packages/vue-query/src/useBaseQuery.ts
index 70c69909d..db804942a 100644
--- a/packages/vue-query/src/useBaseQuery.ts
+++ b/packages/vue-query/src/useBaseQuery.ts
@@ -1,22 +1,22 @@
 import {
+  computed,
   onScopeDispose,
-  toRefs,
-  readonly,
   reactive,
-  watch,
-  computed,
+  readonly,
+  toRefs,
   unref,
+  watch,
 } from 'vue-demi'
+import { useQueryClient } from './useQueryClient'
+import { cloneDeepUnref, isQueryKey, updateState } from './utils'
 import type { ToRefs, UnwrapRef } from 'vue-demi'
 import type {
-  QueryObserver,
+  QueryFunction,
   QueryKey,
+  QueryObserver,
   QueryObserverOptions,
   QueryObserverResult,
-  QueryFunction,
 } from '@tanstack/query-core'
-import { useQueryClient } from './useQueryClient'
-import { updateState, isQueryKey, cloneDeepUnref } from './utils'
 import type { MaybeRef, WithQueryClientKey } from './types'
 import type { UseQueryOptions } from './useQuery'
 import type { UseInfiniteQueryOptions } from './useInfiniteQuery'
diff --git a/packages/vue-query/src/useInfiniteQuery.ts b/packages/vue-query/src/useInfiniteQuery.ts
index 6b55c53c0..c3b1ab66a 100644
--- a/packages/vue-query/src/useInfiniteQuery.ts
+++ b/packages/vue-query/src/useInfiniteQuery.ts
@@ -1,19 +1,19 @@
 import { InfiniteQueryObserver } from '@tanstack/query-core'
+import { useBaseQuery } from './useBaseQuery'
 import type { UnwrapRef } from 'vue-demi'
 import type {
-  QueryObserver,
+  InfiniteQueryObserverResult,
   QueryFunction,
   QueryKey,
-  InfiniteQueryObserverResult,
+  QueryObserver,
 } from '@tanstack/query-core'
 
-import { useBaseQuery } from './useBaseQuery'
 import type { UseQueryReturnType } from './useBaseQuery'
 
 import type {
-  WithQueryClientKey,
-  VueInfiniteQueryObserverOptions,
   DistributiveOmit,
+  VueInfiniteQueryObserverOptions,
+  WithQueryClientKey,
 } from './types'
 
 export type UseInfiniteQueryOptions<
diff --git a/packages/vue-query/src/useIsFetching.ts b/packages/vue-query/src/useIsFetching.ts
index c19e1a8ed..dced975c0 100644
--- a/packages/vue-query/src/useIsFetching.ts
+++ b/packages/vue-query/src/useIsFetching.ts
@@ -1,9 +1,9 @@
-import { computed, unref, onScopeDispose, ref, watch } from 'vue-demi'
-import type { Ref } from 'vue-demi'
-import type { QueryKey, QueryFilters as QF } from '@tanstack/query-core'
-
+import { computed, onScopeDispose, ref, unref, watch } from 'vue-demi'
 import { useQueryClient } from './useQueryClient'
 import { cloneDeepUnref, isQueryKey } from './utils'
+import type { Ref } from 'vue-demi'
+import type { QueryFilters as QF, QueryKey } from '@tanstack/query-core'
+
 import type { MaybeRef, MaybeRefDeep, WithQueryClientKey } from './types'
 
 export type QueryFilters = MaybeRefDeep<WithQueryClientKey<QF>>
diff --git a/packages/vue-query/src/useIsMutating.ts b/packages/vue-query/src/useIsMutating.ts
index 1c148f922..d9880dd12 100644
--- a/packages/vue-query/src/useIsMutating.ts
+++ b/packages/vue-query/src/useIsMutating.ts
@@ -1,9 +1,9 @@
-import { computed, unref, onScopeDispose, ref, watch } from 'vue-demi'
-import type { Ref } from 'vue-demi'
-import type { MutationKey, MutationFilters as MF } from '@tanstack/query-core'
-
+import { computed, onScopeDispose, ref, unref, watch } from 'vue-demi'
 import { useQueryClient } from './useQueryClient'
 import { cloneDeepUnref, isQueryKey } from './utils'
+import type { Ref } from 'vue-demi'
+import type { MutationFilters as MF, MutationKey } from '@tanstack/query-core'
+
 import type { MaybeRef, MaybeRefDeep, WithQueryClientKey } from './types'
 
 export type MutationFilters = MaybeRefDeep<WithQueryClientKey<MF>>
diff --git a/packages/vue-query/src/useMutation.ts b/packages/vue-query/src/useMutation.ts
index bf45e2c17..200d55d2e 100644
--- a/packages/vue-query/src/useMutation.ts
+++ b/packages/vue-query/src/useMutation.ts
@@ -1,30 +1,30 @@
 import {
+  computed,
   onScopeDispose,
   reactive,
   readonly,
   toRefs,
-  watch,
-  computed,
   unref,
+  watch,
 } from 'vue-demi'
+import { MutationObserver } from '@tanstack/query-core'
+import { cloneDeepUnref, isMutationKey, updateState } from './utils'
+import { useQueryClient } from './useQueryClient'
 import type { ToRefs } from 'vue-demi'
 import type {
+  MutateFunction,
   MutateOptions,
   MutationFunction,
   MutationKey,
-  MutateFunction,
-  MutationObserverResult,
   MutationObserverOptions,
+  MutationObserverResult,
 } from '@tanstack/query-core'
 import type {
-  WithQueryClientKey,
+  DistributiveOmit,
   MaybeRef,
   MaybeRefDeep,
-  DistributiveOmit,
+  WithQueryClientKey,
 } from './types'
-import { MutationObserver } from '@tanstack/query-core'
-import { cloneDeepUnref, updateState, isMutationKey } from './utils'
-import { useQueryClient } from './useQueryClient'
 
 type MutationResult<TData, TError, TVariables, TContext> = DistributiveOmit<
   MutationObserverResult<TData, TError, TVariables, TContext>,
diff --git a/packages/vue-query/src/useQueries.ts b/packages/vue-query/src/useQueries.ts
index 112ca8490..a207f70a2 100644
--- a/packages/vue-query/src/useQueries.ts
+++ b/packages/vue-query/src/useQueries.ts
@@ -1,12 +1,12 @@
 /* eslint-disable @typescript-eslint/no-explicit-any */
 import { QueriesObserver } from '@tanstack/query-core'
 import { computed, onScopeDispose, reactive, readonly, watch } from 'vue-demi'
+import { useQueryClient } from './useQueryClient'
+import { cloneDeepUnref } from './utils'
 import type { Ref } from 'vue-demi'
 
 import type { QueryFunction, QueryObserverResult } from '@tanstack/query-core'
 
-import { useQueryClient } from './useQueryClient'
-import { cloneDeepUnref } from './utils'
 import type { UseQueryOptions } from './useQuery'
 import type { QueryClient } from './queryClient'
 
diff --git a/packages/vue-query/src/useQuery.ts b/packages/vue-query/src/useQuery.ts
index a63ab007a..109bbeb40 100644
--- a/packages/vue-query/src/useQuery.ts
+++ b/packages/vue-query/src/useQuery.ts
@@ -1,17 +1,17 @@
-import type { ToRefs, UnwrapRef } from 'vue-demi'
 import { QueryObserver } from '@tanstack/query-core'
+import { useBaseQuery } from './useBaseQuery'
+import type { ToRefs, UnwrapRef } from 'vue-demi'
 import type {
+  DefinedQueryObserverResult,
   QueryFunction,
   QueryKey,
   QueryObserverResult,
-  DefinedQueryObserverResult,
 } from '@tanstack/query-core'
-import { useBaseQuery } from './useBaseQuery'
 import type { UseQueryReturnType as UQRT } from './useBaseQuery'
 import type {
-  WithQueryClientKey,
-  VueQueryObserverOptions,
   DistributiveOmit,
+  VueQueryObserverOptions,
+  WithQueryClientKey,
 } from './types'
 
 export type UseQueryReturnType<TData, TError> = DistributiveOmit<
diff --git a/packages/vue-query/src/useQueryClient.ts b/packages/vue-query/src/useQueryClient.ts
index 4662d1b12..ddbd75939 100644
--- a/packages/vue-query/src/useQueryClient.ts
+++ b/packages/vue-query/src/useQueryClient.ts
@@ -1,7 +1,7 @@
 import { getCurrentInstance, inject } from 'vue-demi'
 
-import type { QueryClient } from './queryClient'
 import { getClientKey } from './utils'
+import type { QueryClient } from './queryClient'
 
 export function useQueryClient(id = ''): QueryClient {
   const vm = getCurrentInstance()?.proxy
diff --git a/packages/vue-query/src/utils.ts b/packages/vue-query/src/utils.ts
index a754fc477..fe15ab848 100644
--- a/packages/vue-query/src/utils.ts
+++ b/packages/vue-query/src/utils.ts
@@ -1,6 +1,6 @@
 /* eslint-disable @typescript-eslint/no-explicit-any */
-import type { QueryKey, MutationKey } from '@tanstack/query-core'
 import { isRef, unref } from 'vue-demi'
+import type { MutationKey, QueryKey } from '@tanstack/query-core'
 import type { UnwrapRef } from 'vue-demi'
 
 export const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'
diff --git a/packages/vue-query/src/vueQueryPlugin.ts b/packages/vue-query/src/vueQueryPlugin.ts
index 5eb5cf522..f2ff605c6 100644
--- a/packages/vue-query/src/vueQueryPlugin.ts
+++ b/packages/vue-query/src/vueQueryPlugin.ts
@@ -1,10 +1,10 @@
 import { isVue2 } from 'vue-demi'
 import { isServer } from '@tanstack/query-core'
-import type { QueryClientConfig } from '@tanstack/query-core'
 
 import { QueryClient } from './queryClient'
 import { getClientKey } from './utils'
 import { setupDevtools } from './devtools/devtools'
+import type { QueryClientConfig } from '@tanstack/query-core'
 import type { MaybeRefDeep } from './types'
 
 declare global {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 67fae3a63..05dc92ab0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -137,11 +137,11 @@ importers:
         specifier: ^2.3.2
         version: 2.4.0
       nx:
-        specifier: 16.0.1
-        version: 16.0.1
+        specifier: 16.5.2
+        version: 16.5.2
       nx-cloud:
-        specifier: 16.0.5
-        version: 16.0.5
+        specifier: 16.1.0
+        version: 16.1.0
       prettier:
         specifier: ^2.6.2
         version: 2.7.1
@@ -1841,6 +1841,7 @@ packages:
     engines: {node: '>=6.9.0'}
     dependencies:
       '@babel/types': 7.19.0
+    dev: false
 
   /@babel/helper-module-imports@7.16.0:
     resolution: {integrity: sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==}
@@ -1936,6 +1937,7 @@ packages:
       '@babel/types': 7.19.0
     transitivePeerDependencies:
       - supports-color
+    dev: false
 
   /@babel/helper-simple-access@7.18.6:
     resolution: {integrity: sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==}
@@ -2045,7 +2047,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-environment-visitor': 7.18.9
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       '@babel/helper-remap-async-to-generator': 7.18.6(@babel/core@7.9.0)
       '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.9.0)
     transitivePeerDependencies:
@@ -2084,7 +2086,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-create-class-features-plugin': 7.18.6(@babel/core@7.9.0)
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     transitivePeerDependencies:
       - supports-color
     dev: true
@@ -2230,7 +2232,7 @@ packages:
       '@babel/core': ^7.0.0-0
     dependencies:
       '@babel/core': 7.9.0
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.9.0)
     dev: true
 
@@ -2346,7 +2348,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-create-class-features-plugin': 7.18.6(@babel/core@7.9.0)
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     transitivePeerDependencies:
       - supports-color
     dev: true
@@ -2383,7 +2385,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-create-regexp-features-plugin': 7.18.6(@babel/core@7.9.0)
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     dev: true
 
   /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.19.1):
@@ -2734,7 +2736,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-module-imports': 7.18.6
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       '@babel/helper-remap-async-to-generator': 7.18.6(@babel/core@7.9.0)
     transitivePeerDependencies:
       - supports-color
@@ -2807,8 +2809,8 @@ packages:
       '@babel/helper-environment-visitor': 7.18.9
       '@babel/helper-function-name': 7.19.0
       '@babel/helper-optimise-call-expression': 7.18.6
-      '@babel/helper-plugin-utils': 7.20.2
-      '@babel/helper-replace-supers': 7.19.1
+      '@babel/helper-plugin-utils': 7.19.0
+      '@babel/helper-replace-supers': 7.18.6
       '@babel/helper-split-export-declaration': 7.18.6
       globals: 11.12.0
     transitivePeerDependencies:
@@ -2871,7 +2873,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-create-regexp-features-plugin': 7.18.6(@babel/core@7.9.0)
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     dev: true
 
   /@babel/plugin-transform-duplicate-keys@7.18.6(@babel/core@7.19.1):
@@ -2911,7 +2913,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-builder-binary-assignment-operator-visitor': 7.18.6
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     dev: true
 
   /@babel/plugin-transform-flow-strip-types@7.18.6(@babel/core@7.19.1):
@@ -2963,7 +2965,7 @@ packages:
       '@babel/core': 7.9.0
       '@babel/helper-compilation-targets': 7.19.1(@babel/core@7.9.0)
       '@babel/helper-function-name': 7.19.0
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     dev: true
 
   /@babel/plugin-transform-literals@7.18.6(@babel/core@7.19.1):
@@ -3025,7 +3027,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-module-transforms': 7.19.0
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       babel-plugin-dynamic-import-node: 2.3.3
     transitivePeerDependencies:
       - supports-color
@@ -3053,7 +3055,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-module-transforms': 7.19.0
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       '@babel/helper-simple-access': 7.18.6
       babel-plugin-dynamic-import-node: 2.3.3
     transitivePeerDependencies:
@@ -3084,7 +3086,7 @@ packages:
       '@babel/core': 7.9.0
       '@babel/helper-hoist-variables': 7.18.6
       '@babel/helper-module-transforms': 7.19.0
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       '@babel/helper-validator-identifier': 7.18.6
       babel-plugin-dynamic-import-node: 2.3.3
     transitivePeerDependencies:
@@ -3134,7 +3136,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-create-regexp-features-plugin': 7.18.6(@babel/core@7.9.0)
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     dev: true
 
   /@babel/plugin-transform-new-target@7.18.6(@babel/core@7.19.1):
@@ -3307,7 +3309,7 @@ packages:
       '@babel/core': ^7.0.0-0
     dependencies:
       '@babel/core': 7.9.0
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       regenerator-transform: 0.15.0
     dev: true
 
@@ -3378,7 +3380,7 @@ packages:
       '@babel/core': ^7.0.0-0
     dependencies:
       '@babel/core': 7.9.0
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
       '@babel/helper-skip-transparent-expression-wrappers': 7.18.6
     dev: true
 
@@ -3517,7 +3519,7 @@ packages:
     dependencies:
       '@babel/core': 7.9.0
       '@babel/helper-create-regexp-features-plugin': 7.18.6(@babel/core@7.9.0)
-      '@babel/helper-plugin-utils': 7.20.2
+      '@babel/helper-plugin-utils': 7.19.0
     dev: true
 
   /@babel/preset-env@7.12.17(@babel/core@7.9.0):
@@ -4197,7 +4199,7 @@ packages:
       getenv: 1.0.0
       glob: 7.1.6
       resolve-from: 5.0.0
-      semver: 7.3.8
+      semver: 7.5.3
       slash: 3.0.0
       xcode: 3.0.1
       xml2js: 0.4.23
@@ -4219,7 +4221,7 @@ packages:
       getenv: 1.0.0
       glob: 7.1.6
       resolve-from: 5.0.0
-      semver: 7.3.8
+      semver: 7.5.3
       slash: 3.0.0
       xcode: 3.0.1
       xml2js: 0.4.23
@@ -5369,27 +5371,27 @@ packages:
       '@nodelib/fs.scandir': 2.1.5
       fastq: 1.13.0
 
-  /@nrwl/nx-cloud@16.0.5:
-    resolution: {integrity: sha512-1p82ym8WE9ziejwgPslstn19iV/VkHfHfKr/5YOnfCHQS+NxUf92ogcYhHXtqWLblVZ9Zs4W4pkSXK4e04wCmQ==}
+  /@nrwl/nx-cloud@16.1.0:
+    resolution: {integrity: sha512-OFjbSqdCuZq9KRYU/mOlIN8SYLZREsLlZYqYpObZqXJ5meUgBDJbUSwRweUSUvt73fgRixLEau2jPysiLHKxSQ==}
     dependencies:
-      nx-cloud: 16.0.5
+      nx-cloud: 16.1.0
     transitivePeerDependencies:
       - debug
     dev: true
 
-  /@nrwl/tao@16.0.1:
-    resolution: {integrity: sha512-mvY+hKJwismbZY9WIfyO8wAOm1xtHn7ibUgiP/mazJv5OM3lnDoSfE83YlCVuhW+KgNq9OHQwIiAU+Y+hFQvEQ==}
+  /@nrwl/tao@16.5.2:
+    resolution: {integrity: sha512-4vQt0Jj9xHc8SpNgM2TxkPZrkjf4ayNW7elgt5rlOT1yD3Q1Fn3/VHb3cWtm/RC2vSckB4qUEuFGpdEU8wEnCg==}
     hasBin: true
     dependencies:
-      nx: 16.0.1
+      nx: 16.5.2
     transitivePeerDependencies:
       - '@swc-node/register'
       - '@swc/core'
       - debug
     dev: true
 
-  /@nx/nx-darwin-arm64@16.0.1:
-    resolution: {integrity: sha512-ezBykAa6etDIQdh0Rvl8AysJV7lU+/4Grxh0DYMWlVw9EsdJXh5ELr2NepnacdzML411cVSuo6m3SIT5NvMw2Q==}
+  /@nx/nx-darwin-arm64@16.5.2:
+    resolution: {integrity: sha512-myiNbDJLhhVHRLo6z3TeiaUeYTWdvBR3RdHQq4szTgb82Bnn8ruzteRGGJwKZd551YlttRcieBysxzUzHkmVBg==}
     engines: {node: '>= 10'}
     cpu: [arm64]
     os: [darwin]
@@ -5397,8 +5399,8 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-darwin-x64@16.0.1:
-    resolution: {integrity: sha512-ZTFVN0E+02EeWvToyKu1lQWdKHzPbks4R90Pw0cdDgnOaaYj2Z9GQ1rBo+3hq6K2xQb8ONOtsV3uWvrLKoQKww==}
+  /@nx/nx-darwin-x64@16.5.2:
+    resolution: {integrity: sha512-m354qmKrv7a5eD9Qv8bGEmrLCBEyCS6/y0PyOR32Dmi7qwlgHsQ4FfVkOnlWefC5ednhFLJQT6yxwhg8cFGDxw==}
     engines: {node: '>= 10'}
     cpu: [x64]
     os: [darwin]
@@ -5406,8 +5408,17 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-linux-arm-gnueabihf@16.0.1:
-    resolution: {integrity: sha512-WmmVXv5HBNRzn/vWUYapJC5+CPUBaIXo6O8Iz+bniiHtsXeV5W5aYwveF1QOkHePLwUtkE18V1LDIkYksOEHOQ==}
+  /@nx/nx-freebsd-x64@16.5.2:
+    resolution: {integrity: sha512-qrR9yxcC2BLnw9JulecILmyp6Jco9unHHzQcfhLZTpw5c1PNHmZzHwJ3i3iNEf1o2kXEIa+SlOCis9ndvNQQVA==}
+    engines: {node: '>= 10'}
+    cpu: [x64]
+    os: [freebsd]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@nx/nx-linux-arm-gnueabihf@16.5.2:
+    resolution: {integrity: sha512-+I1Oj54caDymMsQuRu/l4ULS4RVvwDUM1nXey5JhWulDOUF//09Ckz03Q9p0NCnvBvQd3SyE65++PMfZrrurbA==}
     engines: {node: '>= 10'}
     cpu: [arm]
     os: [linux]
@@ -5415,8 +5426,8 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-linux-arm64-gnu@16.0.1:
-    resolution: {integrity: sha512-G8tOXwi5qmeBcwDah/FB7ge25Iimyu6jXuB+zL/IBXgE98Q0JtWJF/VRI5x3eo7xGq0XWH1V7msgIXN17/RNbQ==}
+  /@nx/nx-linux-arm64-gnu@16.5.2:
+    resolution: {integrity: sha512-4Q4jpgtNBTb4lMegFKS9hkzS/WttH3MxkgM//8qs1zhgUz/AsuXTitBo71E3xCnQl/i38p0eIpiKXXwBJeHgDw==}
     engines: {node: '>= 10'}
     cpu: [arm64]
     os: [linux]
@@ -5424,8 +5435,8 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-linux-arm64-musl@16.0.1:
-    resolution: {integrity: sha512-wokwHMtvTzisw8G9VHgKAfPLtPsKlkJqOXJJpHkbxKXDZvwf/AQs03xDWCSV2P7B277VIPWJxuZ7pFqne0nRfw==}
+  /@nx/nx-linux-arm64-musl@16.5.2:
+    resolution: {integrity: sha512-VLukS/pfenr/Qw/EUn3GPAREDVXuSmfKeYBQKkALXEK6cRVQhXFXMLGHgMemCYbpoUJyFtFEO94PKV7VU7wZPg==}
     engines: {node: '>= 10'}
     cpu: [arm64]
     os: [linux]
@@ -5433,8 +5444,8 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-linux-x64-gnu@16.0.1:
-    resolution: {integrity: sha512-9GUs45JmqpGz14ZXt4636rxj6mul0UO9S6dJpJND7M3KPFbPELg0Urj9BUtXz4vhwL2lhKMcz6XvBpQSjyE2bg==}
+  /@nx/nx-linux-x64-gnu@16.5.2:
+    resolution: {integrity: sha512-TAGmY+MXbNl/aGg2KMvtg53rbmX0XHwnJRQtjhjqjAyvaOfFWI/WOqTU7xf/QCkXBUIK0D9xHWpALfA/fZFCBA==}
     engines: {node: '>= 10'}
     cpu: [x64]
     os: [linux]
@@ -5442,8 +5453,8 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-linux-x64-musl@16.0.1:
-    resolution: {integrity: sha512-vGq6e6/v+/YiKZeyKNyTmYNavOFTSHRAyze9I4UGB0aRouYrEuuemBSdCff+IXtwvUZEgYkEW5vTJainRBG+ig==}
+  /@nx/nx-linux-x64-musl@16.5.2:
+    resolution: {integrity: sha512-YyWmqcNbZgU76+LThAt+0arx9C2ewfI5UUI6kooZRniAd408EA2xl5fx2AWLLrISGH4nTb5p20HGmeWfGqjHPA==}
     engines: {node: '>= 10'}
     cpu: [x64]
     os: [linux]
@@ -5451,8 +5462,8 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-win32-arm64-msvc@16.0.1:
-    resolution: {integrity: sha512-3xROoV57qq6ibzmeTNcx8j7Rdj3hmSryzge2ynh9Zr+4dFT4WrsF72WRYQg/kbgNRhV+IfDNq5SMM2mPDl+aRw==}
+  /@nx/nx-win32-arm64-msvc@16.5.2:
+    resolution: {integrity: sha512-pl7LluCc/57kl9VZ1ES27ym16ps4zgfCIeJiF8Ne8C6ALgt7C3PEG6417sFqbQw5J7NhsZ1aTb3eJ9fa9hurhA==}
     engines: {node: '>= 10'}
     cpu: [arm64]
     os: [win32]
@@ -5460,8 +5471,8 @@ packages:
     dev: true
     optional: true
 
-  /@nx/nx-win32-x64-msvc@16.0.1:
-    resolution: {integrity: sha512-7jkC3kukEBnV/1+YMFY0VjbGGlGihpQEj3LrgjVdM8+Uf1qcyKhmHlVV3iJ87Bix+wVG7TmsSJ+XPchh0FJlsw==}
+  /@nx/nx-win32-x64-msvc@16.5.2:
+    resolution: {integrity: sha512-bKSMElhzP37MkzWQ/Y12pQlesZ6TxwOOqwoaK/vHe6ZtxPxvG2+U8tQ21Nw5L3KyrDCnU5MJHGFtQVHHHt5MwA==}
     engines: {node: '>= 10'}
     cpu: [x64]
     os: [win32]
@@ -5908,7 +5919,7 @@ packages:
   /@swc/helpers@0.4.2:
     resolution: {integrity: sha512-556Az0VX7WR6UdoTn4htt/l3zPQ7bsQWK+HqdG4swV7beUCxo/BqmvbOpUkTIm/9ih86LIf1qsUnywNL3obGHw==}
     dependencies:
-      tslib: 2.4.1
+      tslib: 2.6.0
     dev: false
 
   /@tanstack/match-sorter-utils@8.1.1:
@@ -6344,7 +6355,7 @@ packages:
       eslint: 8.26.0
       ignore: 5.2.0
       regexpp: 3.2.0
-      semver: 7.3.8
+      semver: 7.5.3
       tsutils: 3.21.0(typescript@4.8.4)
       typescript: 4.8.4
     transitivePeerDependencies:
@@ -6370,7 +6381,7 @@ packages:
       eslint: 8.34.0
       ignore: 5.2.0
       regexpp: 3.2.0
-      semver: 7.3.8
+      semver: 7.5.3
       tsutils: 3.21.0(typescript@4.4.4)
       typescript: 4.4.4
     transitivePeerDependencies:
@@ -6550,7 +6561,7 @@ packages:
       debug: 4.3.4
       globby: 11.1.0
       is-glob: 4.0.3
-      semver: 7.3.8
+      semver: 7.5.3
       tsutils: 3.21.0(typescript@4.4.4)
       typescript: 4.4.4
     transitivePeerDependencies:
@@ -6571,7 +6582,7 @@ packages:
       debug: 4.3.4
       globby: 11.1.0
       is-glob: 4.0.3
-      semver: 7.3.8
+      semver: 7.5.3
       tsutils: 3.21.0(typescript@4.8.3)
       typescript: 4.8.3
     transitivePeerDependencies:
@@ -6592,7 +6603,7 @@ packages:
       debug: 4.3.4
       globby: 11.1.0
       is-glob: 4.0.3
-      semver: 7.3.8
+      semver: 7.5.3
       tsutils: 3.21.0(typescript@4.8.4)
       typescript: 4.8.4
     transitivePeerDependencies:
@@ -6613,7 +6624,7 @@ packages:
       eslint: 8.26.0
       eslint-scope: 5.1.1
       eslint-utils: 3.0.0(eslint@8.26.0)
-      semver: 7.3.8
+      semver: 7.5.3
     transitivePeerDependencies:
       - supports-color
       - typescript
@@ -6633,7 +6644,7 @@ packages:
       eslint: 8.34.0
       eslint-scope: 5.1.1
       eslint-utils: 3.0.0(eslint@8.34.0)
-      semver: 7.3.8
+      semver: 7.5.3
     transitivePeerDependencies:
       - supports-color
       - typescript
@@ -6653,7 +6664,7 @@ packages:
       eslint: 8.34.0
       eslint-scope: 5.1.1
       eslint-utils: 3.0.0(eslint@8.34.0)
-      semver: 7.3.8
+      semver: 7.5.3
     transitivePeerDependencies:
       - supports-color
       - typescript
@@ -7108,8 +7119,8 @@ packages:
     resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==}
     dev: true
 
-  /@yarnpkg/parsers@3.0.0-rc.40:
-    resolution: {integrity: sha512-sKbi5XhHKXCjzb5m0ftGuQuODM2iUXEsrCSl8MkKexNWHepCmU3IPaGTPC5gHZy4sOvsb9JqTLaZEez+kDzG+Q==}
+  /@yarnpkg/parsers@3.0.0-rc.46:
+    resolution: {integrity: sha512-aiATs7pSutzda/rq8fnuPwTglyVwjM22bNnK2ZgjrpAjQHSSl3lztd2f9evst1W/qnC58DRz7T7QndUDumAR4Q==}
     engines: {node: '>=14.15.0'}
     dependencies:
       js-yaml: 3.14.1
@@ -8460,7 +8471,7 @@ packages:
     dev: false
 
   /concat-map@0.0.1:
-    resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
+    resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
 
   /concurrently@7.2.2:
     resolution: {integrity: sha512-DcQkI0ruil5BA/g7Xy3EWySGrFJovF5RYAYxwGvv9Jf9q9B1v3jPFP2tl6axExNf1qgF30kjoNYrangZ0ey4Aw==}
@@ -12043,7 +12054,7 @@ packages:
       jest-util: 27.5.1
       natural-compare: 1.4.0
       pretty-format: 27.5.1
-      semver: 7.3.8
+      semver: 7.5.3
     transitivePeerDependencies:
       - supports-color
     dev: true
@@ -13703,7 +13714,7 @@ packages:
     dependencies:
       hosted-git-info: 4.1.0
       is-core-module: 2.12.1
-      semver: 7.3.8
+      semver: 7.5.3
       validate-npm-package-license: 3.0.4
     dev: true
 
@@ -13751,11 +13762,11 @@ packages:
     resolution: {integrity: sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==}
     dev: true
 
-  /nx-cloud@16.0.5:
-    resolution: {integrity: sha512-13P7r0aKikjBtmdZrNorwXzVPeVIV4MLEwqGY+DEG6doLBtI5KqEQk/d5B5l2dCF2BEi/LXEmLYCmf9gwbOJ+Q==}
+  /nx-cloud@16.1.0:
+    resolution: {integrity: sha512-2K5OuJ4MEDrn2solje2X+a3UxSCdfR5PIscCRQbBANyvJfl3hGJSTxz0n5xeJJX4cKcQlfAxDQFRH6DHNdTGPQ==}
     hasBin: true
     dependencies:
-      '@nrwl/nx-cloud': 16.0.5
+      '@nrwl/nx-cloud': 16.1.0
       axios: 1.1.3
       chalk: 4.1.2
       dotenv: 10.0.0
@@ -13769,8 +13780,8 @@ packages:
       - debug
     dev: true
 
-  /nx@16.0.1:
-    resolution: {integrity: sha512-x1NUs3ZGRWI3CdY1Qt4JdB9fOpjNkfP064HI3P6YjmHYSilbkVF7xe9bxOptjwCgMlTE3kOa66qC2fI5bKvG4w==}
+  /nx@16.5.2:
+    resolution: {integrity: sha512-3XAkVBhXuoFgD7r0lASOh2589XSmBUjioevZb13lDjKDN/FHFWedwMZWtmmbzxBGO3EAWjl+3owBS1RIPm1UHw==}
     hasBin: true
     requiresBuild: true
     peerDependencies:
@@ -13782,10 +13793,10 @@ packages:
       '@swc/core':
         optional: true
     dependencies:
-      '@nrwl/tao': 16.0.1
+      '@nrwl/tao': 16.5.2
       '@parcel/watcher': 2.0.4
       '@yarnpkg/lockfile': 1.1.0
-      '@yarnpkg/parsers': 3.0.0-rc.40
+      '@yarnpkg/parsers': 3.0.0-rc.46
       '@zkochan/js-yaml': 0.0.6
       axios: 1.3.4
       chalk: 4.1.2
@@ -13806,26 +13817,27 @@ packages:
       minimatch: 3.0.5
       npm-run-path: 4.0.1
       open: 8.4.0
-      semver: 7.3.4
+      semver: 7.5.3
       string-width: 4.2.3
       strong-log-transformer: 2.1.0
       tar-stream: 2.2.0
       tmp: 0.2.1
       tsconfig-paths: 4.1.2
-      tslib: 2.4.1
+      tslib: 2.6.0
       v8-compile-cache: 2.3.0
       yargs: 17.7.1
       yargs-parser: 21.1.1
     optionalDependencies:
-      '@nx/nx-darwin-arm64': 16.0.1
-      '@nx/nx-darwin-x64': 16.0.1
-      '@nx/nx-linux-arm-gnueabihf': 16.0.1
-      '@nx/nx-linux-arm64-gnu': 16.0.1
-      '@nx/nx-linux-arm64-musl': 16.0.1
-      '@nx/nx-linux-x64-gnu': 16.0.1
-      '@nx/nx-linux-x64-musl': 16.0.1
-      '@nx/nx-win32-arm64-msvc': 16.0.1
-      '@nx/nx-win32-x64-msvc': 16.0.1
+      '@nx/nx-darwin-arm64': 16.5.2
+      '@nx/nx-darwin-x64': 16.5.2
+      '@nx/nx-freebsd-x64': 16.5.2
+      '@nx/nx-linux-arm-gnueabihf': 16.5.2
+      '@nx/nx-linux-arm64-gnu': 16.5.2
+      '@nx/nx-linux-arm64-musl': 16.5.2
+      '@nx/nx-linux-x64-gnu': 16.5.2
+      '@nx/nx-linux-x64-musl': 16.5.2
+      '@nx/nx-win32-arm64-msvc': 16.5.2
+      '@nx/nx-win32-x64-msvc': 16.5.2
     transitivePeerDependencies:
       - debug
     dev: true
@@ -15512,16 +15524,16 @@ packages:
     engines: {node: '>=10'}
     hasBin: true
 
-  /semver@7.3.4:
-    resolution: {integrity: sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==}
+  /semver@7.3.8:
+    resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==}
     engines: {node: '>=10'}
     hasBin: true
     dependencies:
       lru-cache: 6.0.0
     dev: true
 
-  /semver@7.3.8:
-    resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==}
+  /semver@7.5.3:
+    resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==}
     engines: {node: '>=10'}
     hasBin: true
     dependencies:
@@ -16760,6 +16772,7 @@ packages:
 
   /tslib@2.4.1:
     resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==}
+    dev: true
 
   /tslib@2.6.0:
     resolution: {integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==}


Test patch:
diff --git a/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.test.ts b/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.test.ts
index 0c893688e..9f8f37292 100644
--- a/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.test.ts
+++ b/packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.test.ts
@@ -1,6 +1,6 @@
-import { rule, name } from './prefer-query-object-syntax'
-import { normalizeIndent } from '../../utils/test-utils'
 import { ESLintUtils } from '@typescript-eslint/utils'
+import { normalizeIndent } from '../../utils/test-utils'
+import { name, rule } from './prefer-query-object-syntax'
 
 const ruleTester = new ESLintUtils.RuleTester({
   parser: '@typescript-eslint/parser',
diff --git a/packages/query-core/src/tests/focusManager.test.tsx b/packages/query-core/src/tests/focusManager.test.tsx
index 645a93f47..6e23df625 100644
--- a/packages/query-core/src/tests/focusManager.test.tsx
+++ b/packages/query-core/src/tests/focusManager.test.tsx
@@ -38,20 +38,6 @@ describe('focusManager', () => {
     expect(focusManager.isFocused()).toBeTruthy()
   })
 
-  it('should not notify listeners on focus if already focused', async () => {
-    const subscriptionSpy = jest.fn()
-    const unsubscribe = focusManager.subscribe(subscriptionSpy)
-
-    focusManager.setFocused(true)
-    expect(subscriptionSpy).toHaveBeenCalledTimes(1)
-    subscriptionSpy.mockReset()
-
-    focusManager.setFocused(false)
-    expect(subscriptionSpy).toHaveBeenCalledTimes(0)
-
-    unsubscribe()
-  })
-
   it('should return true for isFocused if document is undefined', async () => {
     const { document } = globalThis
 
@@ -152,4 +138,25 @@ describe('focusManager', () => {
 
     unsubscribe2()
   })
+
+  test('should call listeners when setFocused is called', () => {
+    const listener = jest.fn()
+
+    focusManager.subscribe(listener)
+
+    focusManager.setFocused(true)
+    focusManager.setFocused(true)
+
+    expect(listener).toHaveBeenCalledTimes(1)
+
+    focusManager.setFocused(false)
+    focusManager.setFocused(false)
+
+    expect(listener).toHaveBeenCalledTimes(2)
+
+    focusManager.setFocused(undefined)
+    focusManager.setFocused(undefined)
+
+    expect(listener).toHaveBeenCalledTimes(3)
+  })
 })
diff --git a/packages/query-core/src/tests/hydration.test.tsx b/packages/query-core/src/tests/hydration.test.tsx
index f4c863936..90d268e2e 100644
--- a/packages/query-core/src/tests/hydration.test.tsx
+++ b/packages/query-core/src/tests/hydration.test.tsx
@@ -1,11 +1,11 @@
+import { QueryCache } from '../queryCache'
+import { dehydrate, hydrate } from '../hydration'
 import {
   createQueryClient,
   executeMutation,
   mockNavigatorOnLine,
   sleep,
 } from './utils'
-import { QueryCache } from '../queryCache'
-import { dehydrate, hydrate } from '../hydration'
 
 async function fetchData<TData>(value: TData, ms?: number): Promise<TData> {
   await sleep(ms || 0)
diff --git a/packages/query-core/src/tests/infiniteQueryBehavior.test.tsx b/packages/query-core/src/tests/infiniteQueryBehavior.test.tsx
index 8e215fe41..1370187ba 100644
--- a/packages/query-core/src/tests/infiniteQueryBehavior.test.tsx
+++ b/packages/query-core/src/tests/infiniteQueryBehavior.test.tsx
@@ -1,11 +1,11 @@
 import { waitFor } from '@testing-library/react'
+import { InfiniteQueryObserver } from '@tanstack/query-core'
+import { createQueryClient, queryKey } from './utils'
 import type {
-  QueryClient,
   InfiniteQueryObserverResult,
   QueryCache,
+  QueryClient,
 } from '@tanstack/query-core'
-import { InfiniteQueryObserver } from '@tanstack/query-core'
-import { createQueryClient, queryKey } from './utils'
 
 describe('InfiniteQueryBehavior', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/infiniteQueryObserver.test.tsx b/packages/query-core/src/tests/infiniteQueryObserver.test.tsx
index ed3485ab0..82aeaa639 100644
--- a/packages/query-core/src/tests/infiniteQueryObserver.test.tsx
+++ b/packages/query-core/src/tests/infiniteQueryObserver.test.tsx
@@ -1,6 +1,6 @@
+import { InfiniteQueryObserver } from '..'
 import { createQueryClient, queryKey, sleep } from './utils'
 import type { QueryClient } from '..'
-import { InfiniteQueryObserver } from '..'
 
 describe('InfiniteQueryObserver', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/mutationCache.test.tsx b/packages/query-core/src/tests/mutationCache.test.tsx
index fce78b2a7..4086f59a5 100644
--- a/packages/query-core/src/tests/mutationCache.test.tsx
+++ b/packages/query-core/src/tests/mutationCache.test.tsx
@@ -1,6 +1,6 @@
 import { waitFor } from '@testing-library/react'
-import { queryKey, sleep, executeMutation, createQueryClient } from './utils'
 import { MutationCache, MutationObserver } from '..'
+import { createQueryClient, executeMutation, queryKey, sleep } from './utils'
 
 describe('mutationCache', () => {
   describe('MutationCacheConfig error callbacks', () => {
diff --git a/packages/query-core/src/tests/mutationObserver.test.tsx b/packages/query-core/src/tests/mutationObserver.test.tsx
index 12d1153ab..e09fb3c14 100644
--- a/packages/query-core/src/tests/mutationObserver.test.tsx
+++ b/packages/query-core/src/tests/mutationObserver.test.tsx
@@ -1,7 +1,7 @@
 import { waitFor } from '@testing-library/react'
+import { MutationObserver } from '..'
 import { createQueryClient, sleep } from './utils'
 import type { QueryClient } from '..'
-import { MutationObserver } from '..'
 
 describe('mutationObserver', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/mutations.test.tsx b/packages/query-core/src/tests/mutations.test.tsx
index e9bcc3285..651f9e33a 100644
--- a/packages/query-core/src/tests/mutations.test.tsx
+++ b/packages/query-core/src/tests/mutations.test.tsx
@@ -1,8 +1,8 @@
-import type { QueryClient } from '..'
+import { waitFor } from '@testing-library/react'
+import { MutationObserver } from '../mutationObserver'
 import { createQueryClient, executeMutation, queryKey, sleep } from './utils'
+import type { QueryClient } from '..'
 import type { MutationState } from '../mutation'
-import { MutationObserver } from '../mutationObserver'
-import { waitFor } from '@testing-library/react'
 
 describe('mutations', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/onlineManager.test.tsx b/packages/query-core/src/tests/onlineManager.test.tsx
index c3a00e86d..ab35a7bbf 100644
--- a/packages/query-core/src/tests/onlineManager.test.tsx
+++ b/packages/query-core/src/tests/onlineManager.test.tsx
@@ -145,4 +145,25 @@ describe('onlineManager', () => {
 
     unsubscribe2()
   })
+
+  test('should call listeners when setOnline is called', () => {
+    const listener = jest.fn()
+
+    onlineManager.subscribe(listener)
+
+    onlineManager.setOnline(true)
+    onlineManager.setOnline(true)
+
+    expect(listener).toHaveBeenCalledTimes(1)
+
+    onlineManager.setOnline(false)
+    onlineManager.setOnline(false)
+
+    expect(listener).toHaveBeenCalledTimes(2)
+
+    onlineManager.setOnline(undefined)
+    onlineManager.setOnline(undefined)
+
+    expect(listener).toHaveBeenCalledTimes(3)
+  })
 })
diff --git a/packages/query-core/src/tests/queriesObserver.test.tsx b/packages/query-core/src/tests/queriesObserver.test.tsx
index 5be415ae0..9d0a4d334 100644
--- a/packages/query-core/src/tests/queriesObserver.test.tsx
+++ b/packages/query-core/src/tests/queriesObserver.test.tsx
@@ -1,7 +1,7 @@
 import { waitFor } from '@testing-library/react'
-import { sleep, queryKey, createQueryClient, mockLogger } from './utils'
-import type { QueryClient, QueryObserverResult } from '..'
 import { QueriesObserver, QueryObserver } from '..'
+import { createQueryClient, mockLogger, queryKey, sleep } from './utils'
+import type { QueryClient, QueryObserverResult } from '..'
 import type { QueryKey } from '..'
 
 describe('queriesObserver', () => {
diff --git a/packages/query-core/src/tests/query.test.tsx b/packages/query-core/src/tests/query.test.tsx
index df02050c5..dc2b2bfb2 100644
--- a/packages/query-core/src/tests/query.test.tsx
+++ b/packages/query-core/src/tests/query.test.tsx
@@ -1,9 +1,11 @@
+import { waitFor } from '@testing-library/react'
+import { QueryObserver, isCancelledError, isError, onlineManager } from '..'
 import {
-  sleep,
-  queryKey,
-  mockVisibilityState,
-  mockLogger,
   createQueryClient,
+  mockLogger,
+  mockVisibilityState,
+  queryKey,
+  sleep,
 } from './utils'
 import type {
   QueryCache,
@@ -11,8 +13,6 @@ import type {
   QueryFunctionContext,
   QueryObserverResult,
 } from '..'
-import { QueryObserver, isCancelledError, isError, onlineManager } from '..'
-import { waitFor } from '@testing-library/react'
 
 describe('query', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/queryCache.test.tsx b/packages/query-core/src/tests/queryCache.test.tsx
index 9aad38c11..289382346 100644
--- a/packages/query-core/src/tests/queryCache.test.tsx
+++ b/packages/query-core/src/tests/queryCache.test.tsx
@@ -1,8 +1,8 @@
-import { sleep, queryKey, createQueryClient } from './utils'
-import type { QueryClient } from '..'
+import { waitFor } from '@testing-library/react'
 import { QueryCache, QueryObserver } from '..'
+import { createQueryClient, queryKey, sleep } from './utils'
+import type { QueryClient } from '..'
 import type { Query } from '.././query'
-import { waitFor } from '@testing-library/react'
 
 describe('queryCache', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/queryClient.test.tsx b/packages/query-core/src/tests/queryClient.test.tsx
index a92702009..86731291d 100644
--- a/packages/query-core/src/tests/queryClient.test.tsx
+++ b/packages/query-core/src/tests/queryClient.test.tsx
@@ -1,16 +1,16 @@
 import { waitFor } from '@testing-library/react'
 import '@testing-library/jest-dom'
 
-import { sleep, queryKey, mockLogger, createQueryClient } from './utils'
+import { InfiniteQueryObserver, MutationObserver, QueryObserver } from '..'
+import { focusManager, onlineManager } from '..'
+import { noop } from '../utils'
+import { createQueryClient, mockLogger, queryKey, sleep } from './utils'
 import type {
   QueryCache,
   QueryClient,
   QueryFunction,
   QueryObserverOptions,
 } from '..'
-import { InfiniteQueryObserver, MutationObserver, QueryObserver } from '..'
-import { focusManager, onlineManager } from '..'
-import { noop } from '../utils'
 
 describe('queryClient', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/queryObserver.test.tsx b/packages/query-core/src/tests/queryObserver.test.tsx
index 89e984166..7e3cc8de0 100644
--- a/packages/query-core/src/tests/queryObserver.test.tsx
+++ b/packages/query-core/src/tests/queryObserver.test.tsx
@@ -1,12 +1,12 @@
+import { QueryObserver, focusManager } from '..'
 import {
-  sleep,
-  queryKey,
+  createQueryClient,
   expectType,
   mockLogger,
-  createQueryClient,
+  queryKey,
+  sleep,
 } from './utils'
 import type { QueryClient, QueryObserverResult } from '..'
-import { QueryObserver, focusManager } from '..'
 
 describe('queryObserver', () => {
   let queryClient: QueryClient
diff --git a/packages/query-core/src/tests/utils.test.tsx b/packages/query-core/src/tests/utils.test.tsx
index 415dc0f1c..3cfd7b1c5 100644
--- a/packages/query-core/src/tests/utils.test.tsx
+++ b/packages/query-core/src/tests/utils.test.tsx
@@ -1,12 +1,12 @@
 import {
-  replaceEqualDeep,
-  partialDeepEqual,
+  isPlainArray,
   isPlainObject,
-  parseMutationArgs,
   matchMutation,
+  parseMutationArgs,
+  partialDeepEqual,
+  replaceEqualDeep,
   scheduleMicrotask,
   sleep,
-  isPlainArray,
 } from '../utils'
 import { Mutation } from '../mutation'
 import { createQueryClient } from './utils'
diff --git a/packages/query-core/src/tests/utils.ts b/packages/query-core/src/tests/utils.ts
index 9659fb168..a6b20b511 100644
--- a/packages/query-core/src/tests/utils.ts
+++ b/packages/query-core/src/tests/utils.ts
@@ -1,8 +1,8 @@
 import { act } from '@testing-library/react'
 
-import type { MutationOptions, QueryClientConfig } from '@tanstack/query-core'
 import { QueryClient } from '@tanstack/query-core'
 import * as utils from '../utils'
+import type { MutationOptions, QueryClientConfig } from '@tanstack/query-core'
 
 export function createQueryClient(config?: QueryClientConfig): QueryClient {
   jest.spyOn(console, 'error').mockImplementation(() => undefined)
diff --git a/packages/query-persist-client-core/src/__tests__/persist.test.ts b/packages/query-persist-client-core/src/__tests__/persist.test.ts
index 5bfe4cccb..d1fc542e4 100644
--- a/packages/query-persist-client-core/src/__tests__/persist.test.ts
+++ b/packages/query-persist-client-core/src/__tests__/persist.test.ts
@@ -1,10 +1,10 @@
+import { QueriesObserver } from '@tanstack/query-core'
+import { persistQueryClientSubscribe } from '../persist'
 import {
+  createMockPersister,
   createQueryClient,
   createSpyablePersister,
-  createMockPersister,
 } from './utils'
-import { persistQueryClientSubscribe } from '../persist'
-import { QueriesObserver } from '@tanstack/query-core'
 
 describe('persistQueryClientSubscribe', () => {
   test('should persist mutations', async () => {
diff --git a/packages/query-persist-client-core/src/__tests__/utils.ts b/packages/query-persist-client-core/src/__tests__/utils.ts
index fae201a01..05c7399c3 100644
--- a/packages/query-persist-client-core/src/__tests__/utils.ts
+++ b/packages/query-persist-client-core/src/__tests__/utils.ts
@@ -1,8 +1,8 @@
-import type { QueryClientConfig } from '@tanstack/query-core'
 import { QueryClient } from '@tanstack/query-core'
+import type { QueryClientConfig } from '@tanstack/query-core'
 import type {
-  Persister,
   PersistedClient,
+  Persister,
 } from '@tanstack/query-persist-client-core'
 
 export function createQueryClient(config?: QueryClientConfig): QueryClient {
diff --git a/packages/query-sync-storage-persister/src/__tests__/storageIsFull.test.ts b/packages/query-sync-storage-persister/src/__tests__/storageIsFull.test.ts
index 0eb795c3c..a19f7df7e 100644
--- a/packages/query-sync-storage-persister/src/__tests__/storageIsFull.test.ts
+++ b/packages/query-sync-storage-persister/src/__tests__/storageIsFull.test.ts
@@ -1,8 +1,8 @@
 import {
-  dehydrate,
   MutationCache,
   QueryCache,
   QueryClient,
+  dehydrate,
 } from '@tanstack/query-core'
 import { removeOldestQuery } from '@tanstack/query-persist-client-core'
 import { createSyncStoragePersister } from '../index'
diff --git a/packages/react-query-devtools/src/__tests__/Explorer.test.tsx b/packages/react-query-devtools/src/__tests__/Explorer.test.tsx
index 7d4dd7e00..e0aefcc63 100644
--- a/packages/react-query-devtools/src/__tests__/Explorer.test.tsx
+++ b/packages/react-query-devtools/src/__tests__/Explorer.test.tsx
@@ -1,7 +1,7 @@
-import { fireEvent, render, screen, act } from '@testing-library/react'
+import { act, fireEvent, render, screen } from '@testing-library/react'
 import * as React from 'react'
 
-import { chunkArray, CopyButton, DefaultRenderer } from '../Explorer'
+import { CopyButton, DefaultRenderer, chunkArray } from '../Explorer'
 import { displayValue } from '../utils'
 
 describe('Explorer', () => {
diff --git a/packages/react-query-devtools/src/__tests__/devtools.test.tsx b/packages/react-query-devtools/src/__tests__/devtools.test.tsx
index 0e79aee4d..1287cc293 100644
--- a/packages/react-query-devtools/src/__tests__/devtools.test.tsx
+++ b/packages/react-query-devtools/src/__tests__/devtools.test.tsx
@@ -1,17 +1,17 @@
 import * as React from 'react'
-import { fireEvent, screen, waitFor, act } from '@testing-library/react'
+import { act, fireEvent, screen, waitFor } from '@testing-library/react'
 import { ErrorBoundary } from 'react-error-boundary'
 import '@testing-library/jest-dom'
-import type { QueryClient } from '@tanstack/react-query'
 import { useQuery } from '@tanstack/react-query'
+import UserEvent from '@testing-library/user-event'
 import { defaultPanelSize, sortFns } from '../utils'
 import {
+  createQueryClient,
   getByTextContent,
   renderWithClient,
   sleep,
-  createQueryClient,
 } from './utils'
-import UserEvent from '@testing-library/user-event'
+import type { QueryClient } from '@tanstack/react-query'
 
 // TODO: This should be removed with the types for react-error-boundary get updated.
 declare module 'react-error-boundary' {
diff --git a/packages/react-query-devtools/src/__tests__/utils.tsx b/packages/react-query-devtools/src/__tests__/utils.tsx
index 197b782af..76c9d7d65 100644
--- a/packages/react-query-devtools/src/__tests__/utils.tsx
+++ b/packages/react-query-devtools/src/__tests__/utils.tsx
@@ -1,12 +1,11 @@
-import { render, type RenderOptions } from '@testing-library/react'
+import { type RenderOptions, render } from '@testing-library/react'
 import * as React from 'react'
-import { ReactQueryDevtools } from '../devtools'
-
 import {
+  QueryCache,
   QueryClient,
   QueryClientProvider,
-  QueryCache,
 } from '@tanstack/react-query'
+import { ReactQueryDevtools } from '../devtools'
 
 export function renderWithClient(
   client: QueryClient,
diff --git a/packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx b/packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx
index 3aa840221..0dc4bb843 100644
--- a/packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx
+++ b/packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx
@@ -1,19 +1,19 @@
 import * as React from 'react'
 import { render, waitFor } from '@testing-library/react'
 
-import type {
-  UseQueryResult,
-  DefinedUseQueryResult,
-} from '@tanstack/react-query'
-import { QueryClient, useQuery, useQueries } from '@tanstack/react-query'
+import { QueryClient, useQueries, useQuery } from '@tanstack/react-query'
+import { persistQueryClientSave } from '@tanstack/query-persist-client-core'
+
+import { PersistQueryClientProvider } from '../PersistQueryClientProvider'
+import { createQueryClient, mockLogger, queryKey, sleep } from './utils'
 import type {
   PersistedClient,
   Persister,
 } from '@tanstack/query-persist-client-core'
-import { persistQueryClientSave } from '@tanstack/query-persist-client-core'
-
-import { createQueryClient, mockLogger, queryKey, sleep } from './utils'
-import { PersistQueryClientProvider } from '../PersistQueryClientProvider'
+import type {
+  DefinedUseQueryResult,
+  UseQueryResult,
+} from '@tanstack/react-query'
 
 const createMockPersister = (): Persister => {
   let storedState: PersistedClient | undefined
@@ -325,7 +325,7 @@ describe('PersistQueryClientProvider', () => {
     await waitFor(() => rendered.getByText('data: null'))
     await waitFor(() => rendered.getByText('data: hydrated'))
 
-    expect(states).toHaveLength(3)
+    expect(states).toHaveLength(2)
 
     expect(fetched).toBe(false)
 
@@ -340,9 +340,6 @@ describe('PersistQueryClientProvider', () => {
       fetchStatus: 'idle',
       data: 'hydrated',
     })
-
-    // #5443 seems like we get an extra render now ...
-    expect(states[1]).toStrictEqual(states[2])
   })
 
   test('should call onSuccess after successful restoring', async () => {
diff --git a/packages/react-query-persist-client/src/__tests__/utils.ts b/packages/react-query-persist-client/src/__tests__/utils.ts
index 312280698..fc94f8c9e 100644
--- a/packages/react-query-persist-client/src/__tests__/utils.ts
+++ b/packages/react-query-persist-client/src/__tests__/utils.ts
@@ -1,7 +1,7 @@
 import { act } from '@testing-library/react'
 
-import type { QueryClientConfig } from '@tanstack/query-core'
 import { QueryClient } from '@tanstack/query-core'
+import type { QueryClientConfig } from '@tanstack/query-core'
 
 export function createQueryClient(config?: QueryClientConfig): QueryClient {
   jest.spyOn(console, 'error').mockImplementation(() => undefined)
diff --git a/packages/react-query/src/__tests__/Hydrate.test.tsx b/packages/react-query/src/__tests__/Hydrate.test.tsx
index ab8939574..1a5c90cd9 100644
--- a/packages/react-query/src/__tests__/Hydrate.test.tsx
+++ b/packages/react-query/src/__tests__/Hydrate.test.tsx
@@ -1,17 +1,17 @@
 import * as React from 'react'
 import { render } from '@testing-library/react'
 
+import * as coreModule from '@tanstack/query-core'
 import {
+  Hydrate,
+  QueryCache,
   QueryClient,
   QueryClientProvider,
-  QueryCache,
-  useQuery,
   dehydrate,
   useHydrate,
-  Hydrate,
+  useQuery,
 } from '@tanstack/react-query'
 import { createQueryClient, sleep } from './utils'
-import * as coreModule from '@tanstack/query-core'
 
 describe('React hydration', () => {
   const fetchData: (value: string) => Promise<string> = (value) =>
diff --git a/packages/react-query/src/__tests__/QueryClientProvider.test.tsx b/packages/react-query/src/__tests__/QueryClientProvider.test.tsx
index 32c1d6702..306807c5e 100644
--- a/packages/react-query/src/__tests__/QueryClientProvider.test.tsx
+++ b/packages/react-query/src/__tests__/QueryClientProvider.test.tsx
@@ -2,14 +2,14 @@ import * as React from 'react'
 import { render, waitFor } from '@testing-library/react'
 import { renderToString } from 'react-dom/server'
 
-import { sleep, queryKey, createQueryClient } from './utils'
 import {
+  QueryCache,
   QueryClient,
   QueryClientProvider,
-  QueryCache,
   useQuery,
   useQueryClient,
 } from '..'
+import { createQueryClient, queryKey, sleep } from './utils'
 
 describe('QueryClientProvider', () => {
   test('sets a specific cache for all queries to use', async () => {
diff --git a/packages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsx b/packages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsx
index bfb835c54..9295ad099 100644
--- a/packages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsx
+++ b/packages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsx
@@ -2,8 +2,8 @@ import { fireEvent, waitFor } from '@testing-library/react'
 import { ErrorBoundary } from 'react-error-boundary'
 import * as React from 'react'
 
-import { createQueryClient, queryKey, renderWithClient, sleep } from './utils'
 import { QueryCache, QueryErrorResetBoundary, useQueries, useQuery } from '..'
+import { createQueryClient, queryKey, renderWithClient, sleep } from './utils'
 
 // TODO: This should be removed with the types for react-error-boundary get updated.
 declare module 'react-error-boundary' {
diff --git a/packages/react-query/src/__tests__/ssr-hydration.test.tsx b/packages/react-query/src/__tests__/ssr-hydration.test.tsx
index 0fcc46b3d..d86124b57 100644
--- a/packages/react-query/src/__tests__/ssr-hydration.test.tsx
+++ b/packages/react-query/src/__tests__/ssr-hydration.test.tsx
@@ -6,11 +6,11 @@ import ReactDOMServer from 'react-dom/server'
 import type {} from 'react-dom/next'
 
 import {
-  useQuery,
-  QueryClientProvider,
   QueryCache,
+  QueryClientProvider,
   dehydrate,
   hydrate,
+  useQuery,
 } from '..'
 import { createQueryClient, setIsServer, sleep } from './utils'
 
diff --git a/packages/react-query/src/__tests__/ssr.test.tsx b/packages/react-query/src/__tests__/ssr.test.tsx
index 4bc097de7..2245d52aa 100644
--- a/packages/react-query/src/__tests__/ssr.test.tsx
+++ b/packages/react-query/src/__tests__/ssr.test.tsx
@@ -6,8 +6,8 @@ import * as React from 'react'
 // @ts-ignore
 import { renderToString } from 'react-dom/server'
 
-import { sleep, queryKey, createQueryClient } from './utils'
-import { useQuery, QueryClientProvider, QueryCache, useInfiniteQuery } from '..'
+import { QueryCache, QueryClientProvider, useInfiniteQuery, useQuery } from '..'
+import { createQueryClient, queryKey, sleep } from './utils'
 
 describe('Server Side Rendering', () => {
   it('should not trigger fetch', () => {
diff --git a/packages/react-query/src/__tests__/suspense.test.tsx b/packages/react-query/src/__tests__/suspense.test.tsx
index 0335d30be..52ab4d6c4 100644
--- a/packages/react-query/src/__tests__/suspense.test.tsx
+++ b/packages/react-query/src/__tests__/suspense.test.tsx
@@ -1,7 +1,6 @@
 import { fireEvent, waitFor } from '@testing-library/react'
 import * as React from 'react'
 import { ErrorBoundary } from 'react-error-boundary'
-import type { UseInfiniteQueryResult, UseQueryResult } from '..'
 import {
   QueryCache,
   QueryErrorResetBoundary,
@@ -11,6 +10,7 @@ import {
   useQueryErrorResetBoundary,
 } from '..'
 import { createQueryClient, queryKey, renderWithClient, sleep } from './utils'
+import type { UseInfiniteQueryResult, UseQueryResult } from '..'
 
 describe("useQuery's in Suspense mode", () => {
   const queryCache = new QueryCache()
diff --git a/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx b/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx
index 122a25181..90c663bba 100644
--- a/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx
+++ b/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx
@@ -1,6 +1,7 @@
 import { fireEvent, waitFor } from '@testing-library/react'
 import * as React from 'react'
 
+import { QueryCache, useInfiniteQuery } from '..'
 import {
   createQueryClient,
   queryKey,
@@ -13,7 +14,6 @@ import type {
   QueryFunctionContext,
   UseInfiniteQueryResult,
 } from '..'
-import { QueryCache, useInfiniteQuery } from '..'
 
 interface Result {
   items: number[]
diff --git a/packages/react-query/src/__tests__/useIsFetching.test.tsx b/packages/react-query/src/__tests__/useIsFetching.test.tsx
index 05e953836..3a041135f 100644
--- a/packages/react-query/src/__tests__/useIsFetching.test.tsx
+++ b/packages/react-query/src/__tests__/useIsFetching.test.tsx
@@ -2,6 +2,7 @@ import { fireEvent, waitFor } from '@testing-library/react'
 import * as React from 'react'
 import { ErrorBoundary } from 'react-error-boundary'
 
+import { QueryCache, useIsFetching, useQuery } from '..'
 import {
   createQueryClient,
   queryKey,
@@ -10,7 +11,6 @@ import {
   sleep,
 } from './utils'
 import type { QueryClient } from '..'
-import { QueryCache, useIsFetching, useQuery } from '..'
 
 describe('useIsFetching', () => {
   // See https://github.com/tannerlinsley/react-query/issues/105
diff --git a/packages/react-query/src/__tests__/useIsMutating.test.tsx b/packages/react-query/src/__tests__/useIsMutating.test.tsx
index 6e65de261..7f1b4f59f 100644
--- a/packages/react-query/src/__tests__/useIsMutating.test.tsx
+++ b/packages/react-query/src/__tests__/useIsMutating.test.tsx
@@ -1,16 +1,16 @@
 import { fireEvent, waitFor } from '@testing-library/react'
 import * as React from 'react'
+import { ErrorBoundary } from 'react-error-boundary'
+import { QueryClient } from '@tanstack/query-core'
 import { useIsMutating } from '../useIsMutating'
 import { useMutation } from '../useMutation'
+import * as MutationCacheModule from '../../../query-core/src/mutationCache'
 import {
   createQueryClient,
   renderWithClient,
   setActTimeout,
   sleep,
 } from './utils'
-import { ErrorBoundary } from 'react-error-boundary'
-import { QueryClient } from '@tanstack/query-core'
-import * as MutationCacheModule from '../../../query-core/src/mutationCache'
 
 describe('useIsMutating', () => {
   it('should return the number of fetching mutations', async () => {
diff --git a/packages/react-query/src/__tests__/useMutation.test.tsx b/packages/react-query/src/__tests__/useMutation.test.tsx
index ff32046f0..e92944561 100644
--- a/packages/react-query/src/__tests__/useMutation.test.tsx
+++ b/packages/react-query/src/__tests__/useMutation.test.tsx
@@ -3,9 +3,7 @@ import '@testing-library/jest-dom'
 import * as React from 'react'
 import { ErrorBoundary } from 'react-error-boundary'
 
-import type { QueryClient } from '..'
 import { MutationCache, QueryCache, useMutation } from '..'
-import type { UseMutationResult } from '../types'
 import {
   createQueryClient,
   mockNavigatorOnLine,
@@ -14,6 +12,8 @@ import {
   setActTimeout,
   sleep,
 } from './utils'
+import type { QueryClient } from '..'
+import type { UseMutationResult } from '../types'
 
 describe('useMutation', () => {
   const queryCache = new QueryCache()
diff --git a/packages/react-query/src/__tests__/useQueries.test.tsx b/packages/react-query/src/__tests__/useQueries.test.tsx
index 1452ee030..6d6fd1a8a 100644
--- a/packages/react-query/src/__tests__/useQueries.test.tsx
+++ b/packages/react-query/src/__tests__/useQueries.test.tsx
@@ -4,6 +4,7 @@ import { ErrorBoundary } from 'react-error-boundary'
 
 import * as QueriesObserverModule from '../../../query-core/src/queriesObserver'
 
+import { QueriesObserver, QueryCache, useQueries } from '..'
 import {
   createQueryClient,
   expectType,
@@ -20,7 +21,6 @@ import type {
   UseQueryOptions,
   UseQueryResult,
 } from '..'
-import { QueriesObserver, QueryCache, useQueries } from '..'
 import type { QueryFunctionContext } from '@tanstack/query-core'
 
 describe('useQueries', () => {
diff --git a/packages/react-query/src/__tests__/useQuery.test.tsx b/packages/react-query/src/__tests__/useQuery.test.tsx
index 2fb62e5b4..592349def 100644
--- a/packages/react-query/src/__tests__/useQuery.test.tsx
+++ b/packages/react-query/src/__tests__/useQuery.test.tsx
@@ -1,6 +1,8 @@
 import { act, fireEvent, waitFor } from '@testing-library/react'
 import '@testing-library/jest-dom'
 import * as React from 'react'
+import { ErrorBoundary } from 'react-error-boundary'
+import { QueryCache, useQuery } from '..'
 import {
   Blink,
   createQueryClient,
@@ -20,8 +22,6 @@ import type {
   UseQueryOptions,
   UseQueryResult,
 } from '..'
-import { QueryCache, useQuery } from '..'
-import { ErrorBoundary } from 'react-error-boundary'
 
 describe('useQuery', () => {
   const queryCache = new QueryCache()
@@ -914,17 +914,15 @@ describe('useQuery', () => {
     // required to make sure no additional renders are happening after data is successfully fetched for the second time
     await sleep(100)
 
-    expect(states.length).toBe(5)
+    expect(states.length).toBe(4)
     // First load
     expect(states[0]).toMatchObject({ isLoading: true, isSuccess: false })
     // First success
     expect(states[1]).toMatchObject({ isLoading: false, isSuccess: true })
     // Remove
     expect(states[2]).toMatchObject({ isLoading: true, isSuccess: false })
-    // Hook state update
-    expect(states[3]).toMatchObject({ isLoading: true, isSuccess: false })
     // Second success
-    expect(states[4]).toMatchObject({ isLoading: false, isSuccess: true })
+    expect(states[3]).toMatchObject({ isLoading: false, isSuccess: true })
   })
 
   it('should fetch when refetchOnMount is false and nothing has been fetched yet', async () => {
@@ -3650,6 +3648,7 @@ describe('useQuery', () => {
           )
           act(() => setPrefetched(true))
         }
+
         prefetch()
       }, [])
 
@@ -5879,6 +5878,7 @@ describe('useQuery', () => {
         </div>
       )
     }
+
     const rendered = renderWithClient(queryClient, <Page />)
     const fetchBtn = rendered.getByRole('button', { name: 'refetch' })
     await waitFor(() => rendered.getByText('data: 1'))
@@ -5916,8 +5916,132 @@ describe('useQuery', () => {
         </div>
       )
     }
+
     const rendered = renderWithClient(queryClient, <Page />)
     await waitFor(() => rendered.getByText('status: success'))
     await waitFor(() => rendered.getByText('data: 1'))
   })
+  it('should reuse same data object reference when queryKey changes back to some cached data', async () => {
+    const spy = jest.fn()
+    const key = queryKey()
+
+    async function fetchNumber(id: number) {
+      await sleep(5)
+      return { numbers: { current: { id } } }
+    }
+    function Test() {
+      const [id, setId] = React.useState(1)
+
+      const { data } = useQuery({
+        select: selector,
+        queryKey: [key, 'user', id],
+        queryFn: () => fetchNumber(id),
+      })
+
+      React.useEffect(() => {
+        spy(data)
+      }, [data])
+
+      return (
+        <div>
+          <button name="1" onClick={() => setId(1)}>
+            1
+          </button>
+          <button name="2" onClick={() => setId(2)}>
+            2
+          </button>
+          <span>Rendered Id: {data?.id}</span>
+        </div>
+      )
+    }
+
+    function selector(data: any) {
+      return data.numbers.current
+    }
+
+    const rendered = renderWithClient(queryClient, <Test />)
+    expect(spy).toHaveBeenCalledTimes(1)
+
+    spy.mockClear()
+    await waitFor(() => rendered.getByText('Rendered Id: 1'))
+    expect(spy).toHaveBeenCalledTimes(1)
+
+    spy.mockClear()
+    fireEvent.click(rendered.getByRole('button', { name: /2/ }))
+    await waitFor(() => rendered.getByText('Rendered Id: 2'))
+    expect(spy).toHaveBeenCalledTimes(2) // called with undefined because id changed
+
+    spy.mockClear()
+    fireEvent.click(rendered.getByRole('button', { name: /1/ }))
+    await waitFor(() => rendered.getByText('Rendered Id: 1'))
+    expect(spy).toHaveBeenCalledTimes(1)
+
+    spy.mockClear()
+    fireEvent.click(rendered.getByRole('button', { name: /2/ }))
+    await waitFor(() => rendered.getByText('Rendered Id: 2'))
+    expect(spy).toHaveBeenCalledTimes(1)
+  })
+  it('should reuse same data object reference when queryKey changes and placeholderData is present', async () => {
+    const spy = jest.fn()
+    const key = queryKey()
+
+    async function fetchNumber(id: number) {
+      await sleep(5)
+      return { numbers: { current: { id } } }
+    }
+    function Test() {
+      const [id, setId] = React.useState(1)
+
+      const { data } = useQuery({
+        select: selector,
+        queryKey: [key, 'user', id],
+        queryFn: () => fetchNumber(id),
+        placeholderData: { numbers: { current: { id: 99 } } },
+      })
+
+      React.useEffect(() => {
+        spy(data)
+      }, [data])
+
+      return (
+        <div>
+          <button name="1" onClick={() => setId(1)}>
+            1
+          </button>
+          <button name="2" onClick={() => setId(2)}>
+            2
+          </button>
+          <span>Rendered Id: {data?.id}</span>
+        </div>
+      )
+    }
+
+    function selector(data: any) {
+      return data.numbers.current
+    }
+
+    const rendered = renderWithClient(queryClient, <Test />)
+    expect(spy).toHaveBeenCalledTimes(1)
+
+    spy.mockClear()
+    await waitFor(() => rendered.getByText('Rendered Id: 99'))
+    await waitFor(() => rendered.getByText('Rendered Id: 1'))
+    expect(spy).toHaveBeenCalledTimes(1)
+
+    spy.mockClear()
+    fireEvent.click(rendered.getByRole('button', { name: /2/ }))
+    await waitFor(() => rendered.getByText('Rendered Id: 99'))
+    await waitFor(() => rendered.getByText('Rendered Id: 2'))
+    expect(spy).toHaveBeenCalledTimes(2) // called with undefined because id changed
+
+    spy.mockClear()
+    fireEvent.click(rendered.getByRole('button', { name: /1/ }))
+    await waitFor(() => rendered.getByText('Rendered Id: 1'))
+    expect(spy).toHaveBeenCalledTimes(1)
+
+    spy.mockClear()
+    fireEvent.click(rendered.getByRole('button', { name: /2/ }))
+    await waitFor(() => rendered.getByText('Rendered Id: 2'))
+    expect(spy).toHaveBeenCalledTimes(1)
+  })
 })
diff --git a/packages/react-query/src/__tests__/utils.tsx b/packages/react-query/src/__tests__/utils.tsx
index d5502a3e2..264c21269 100644
--- a/packages/react-query/src/__tests__/utils.tsx
+++ b/packages/react-query/src/__tests__/utils.tsx
@@ -1,8 +1,8 @@
 import * as React from 'react'
 import { act, render } from '@testing-library/react'
-import type { ContextOptions, QueryClientConfig, MutationOptions } from '..'
-import { QueryClient, QueryClientProvider } from '..'
 import * as utils from '@tanstack/query-core'
+import { QueryClient, QueryClientProvider } from '..'
+import type { ContextOptions, MutationOptions, QueryClientConfig } from '..'
 
 export function renderWithClient(
   client: QueryClient,
diff --git a/packages/solid-query/src/__tests__/QueryClientProvider.test.tsx b/packages/solid-query/src/__tests__/QueryClientProvider.test.tsx
index 1ac05227c..2c9c4ae9e 100644
--- a/packages/solid-query/src/__tests__/QueryClientProvider.test.tsx
+++ b/packages/solid-query/src/__tests__/QueryClientProvider.test.tsx
@@ -1,12 +1,12 @@
 import { render, screen, waitFor } from 'solid-testing-library'
-import { queryKey } from './utils'
 
 import { QueryCache, QueryClient } from '@tanstack/query-core'
-import type { Context } from 'solid-js'
 import { createContext, useContext } from 'solid-js'
 import { renderToString } from 'solid-js/web'
-import { createQuery, QueryClientProvider, useQueryClient } from '..'
+import { QueryClientProvider, createQuery, useQueryClient } from '..'
+import { queryKey } from './utils'
 import { createQueryClient, sleep } from './utils'
+import type { Context } from 'solid-js'
 
 describe('QueryClientProvider', () => {
   it('sets a specific cache for all queries to use', async () => {
diff --git a/packages/solid-query/src/__tests__/createInfiniteQuery.test.tsx b/packages/solid-query/src/__tests__/createInfiniteQuery.test.tsx
index 0c3802d84..32ff10446 100644
--- a/packages/solid-query/src/__tests__/createInfiniteQuery.test.tsx
+++ b/packages/solid-query/src/__tests__/createInfiniteQuery.test.tsx
@@ -1,23 +1,22 @@
 import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
 
-import { createQueryClient, sleep } from './utils'
-
 import {
-  createEffect,
-  createRenderEffect,
-  createSignal,
   For,
   Index,
   Match,
   Switch,
+  createEffect,
+  createRenderEffect,
+  createSignal,
 } from 'solid-js'
+import { QueryCache, QueryClientProvider, createInfiniteQuery } from '..'
+import { createQueryClient, sleep } from './utils'
+import { Blink, queryKey, setActTimeout } from './utils'
 import type {
   CreateInfiniteQueryResult,
   InfiniteData,
   QueryFunctionContext,
 } from '..'
-import { createInfiniteQuery, QueryCache, QueryClientProvider } from '..'
-import { Blink, queryKey, setActTimeout } from './utils'
 
 interface Result {
   items: number[]
diff --git a/packages/solid-query/src/__tests__/createMutation.test.tsx b/packages/solid-query/src/__tests__/createMutation.test.tsx
index ffe7c1ca0..031e803ae 100644
--- a/packages/solid-query/src/__tests__/createMutation.test.tsx
+++ b/packages/solid-query/src/__tests__/createMutation.test.tsx
@@ -1,20 +1,18 @@
 import '@testing-library/jest-dom'
 import {
+  ErrorBoundary,
   createContext,
   createEffect,
   createRenderEffect,
   createSignal,
-  ErrorBoundary,
 } from 'solid-js'
 import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
-import type { QueryClient } from '..'
 import {
-  createMutation,
   MutationCache,
   QueryCache,
   QueryClientProvider,
+  createMutation,
 } from '..'
-import type { CreateMutationResult } from '../types'
 import {
   createQueryClient,
   mockNavigatorOnLine,
@@ -22,6 +20,8 @@ import {
   setActTimeout,
   sleep,
 } from './utils'
+import type { QueryClient } from '..'
+import type { CreateMutationResult } from '../types'
 
 describe('useMutation', () => {
   const queryCache = new QueryCache()
diff --git a/packages/solid-query/src/__tests__/createQueries.test.tsx b/packages/solid-query/src/__tests__/createQueries.test.tsx
index 836943a96..43c911be8 100644
--- a/packages/solid-query/src/__tests__/createQueries.test.tsx
+++ b/packages/solid-query/src/__tests__/createQueries.test.tsx
@@ -1,28 +1,19 @@
 import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
 
-import * as QueriesObserverModule from '../../../query-core/src/queriesObserver'
-
-import type { QueryFunctionContext } from '@tanstack/query-core'
 import {
+  ErrorBoundary,
   createContext,
   createMemo,
   createRenderEffect,
   createSignal,
-  ErrorBoundary,
 } from 'solid-js'
-import type {
-  CreateQueryOptions,
-  CreateQueryResult,
-  QueryClient,
-  QueryFunction,
-  QueryObserverResult,
-  SolidQueryKey,
-} from '..'
+import * as QueriesObserverModule from '../../../query-core/src/queriesObserver'
+
 import {
-  createQueries,
   QueriesObserver,
   QueryCache,
   QueryClientProvider,
+  createQueries,
 } from '..'
 import {
   createQueryClient,
@@ -31,6 +22,15 @@ import {
   queryKey,
   sleep,
 } from './utils'
+import type { QueryFunctionContext } from '@tanstack/query-core'
+import type {
+  CreateQueryOptions,
+  CreateQueryResult,
+  QueryClient,
+  QueryFunction,
+  QueryObserverResult,
+  SolidQueryKey,
+} from '..'
 
 describe('useQueries', () => {
   const queryCache = new QueryCache()
diff --git a/packages/solid-query/src/__tests__/createQuery.test.tsx b/packages/solid-query/src/__tests__/createQuery.test.tsx
index 21b80ad55..6bcc8906e 100644
--- a/packages/solid-query/src/__tests__/createQuery.test.tsx
+++ b/packages/solid-query/src/__tests__/createQuery.test.tsx
@@ -1,23 +1,16 @@
 import '@testing-library/jest-dom'
-import type { JSX } from 'solid-js'
 import {
+  ErrorBoundary,
+  Match,
+  Switch,
   createEffect,
   createMemo,
   createRenderEffect,
   createSignal,
-  ErrorBoundary,
-  Match,
   on,
-  Switch,
 } from 'solid-js'
 import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
-import type {
-  CreateQueryOptions,
-  CreateQueryResult,
-  DefinedCreateQueryResult,
-  QueryFunction,
-} from '..'
-import { createQuery, QueryCache, QueryClientProvider } from '..'
+import { QueryCache, QueryClientProvider, createQuery } from '..'
 import {
   Blink,
   createQueryClient,
@@ -29,6 +22,13 @@ import {
   setActTimeout,
   sleep,
 } from './utils'
+import type {
+  CreateQueryOptions,
+  CreateQueryResult,
+  DefinedCreateQueryResult,
+  QueryFunction,
+} from '..'
+import type { JSX } from 'solid-js'
 
 describe('createQuery', () => {
   const queryCache = new QueryCache()
diff --git a/packages/solid-query/src/__tests__/suspense.test.tsx b/packages/solid-query/src/__tests__/suspense.test.tsx
index 95eccb1e6..f21f326a1 100644
--- a/packages/solid-query/src/__tests__/suspense.test.tsx
+++ b/packages/solid-query/src/__tests__/suspense.test.tsx
@@ -1,21 +1,21 @@
 import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
 
 import {
-  createRenderEffect,
-  createSignal,
   ErrorBoundary,
-  on,
   Show,
   Suspense,
+  createRenderEffect,
+  createSignal,
+  on,
 } from 'solid-js'
-import type { CreateInfiniteQueryResult, CreateQueryResult } from '..'
 import {
-  createInfiniteQuery,
-  createQuery,
   QueryCache,
   QueryClientProvider,
+  createInfiniteQuery,
+  createQuery,
 } from '..'
 import { createQueryClient, queryKey, sleep } from './utils'
+import type { CreateInfiniteQueryResult, CreateQueryResult } from '..'
 
 describe("useQuery's in Suspense mode", () => {
   const queryCache = new QueryCache()
diff --git a/packages/solid-query/src/__tests__/transition.test.tsx b/packages/solid-query/src/__tests__/transition.test.tsx
index af26437ce..5cf1b1ec5 100644
--- a/packages/solid-query/src/__tests__/transition.test.tsx
+++ b/packages/solid-query/src/__tests__/transition.test.tsx
@@ -1,7 +1,7 @@
 import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
 
-import { createSignal, Show, startTransition, Suspense } from 'solid-js'
-import { createQuery, QueryCache, QueryClientProvider } from '..'
+import { Show, Suspense, createSignal, startTransition } from 'solid-js'
+import { QueryCache, QueryClientProvider, createQuery } from '..'
 import { createQueryClient, queryKey, sleep } from './utils'
 
 describe("useQuery's in Suspense mode with transitions", () => {
diff --git a/packages/solid-query/src/__tests__/useIsFetching.test.tsx b/packages/solid-query/src/__tests__/useIsFetching.test.tsx
index 2099a385e..8e5e8198a 100644
--- a/packages/solid-query/src/__tests__/useIsFetching.test.tsx
+++ b/packages/solid-query/src/__tests__/useIsFetching.test.tsx
@@ -1,16 +1,16 @@
 import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
 
 import {
+  ErrorBoundary,
+  Show,
   createContext,
   createEffect,
   createRenderEffect,
   createSignal,
-  ErrorBoundary,
-  Show,
 } from 'solid-js'
-import type { QueryClient } from '..'
-import { createQuery, QueryCache, QueryClientProvider, useIsFetching } from '..'
+import { QueryCache, QueryClientProvider, createQuery, useIsFetching } from '..'
 import { createQueryClient, queryKey, setActTimeout, sleep } from './utils'
+import type { QueryClient } from '..'
 
 describe('useIsFetching', () => {
   // See https://github.com/tannerlinsley/react-query/issues/105
diff --git a/packages/solid-query/src/__tests__/useIsMutating.test.tsx b/packages/solid-query/src/__tests__/useIsMutating.test.tsx
index 64e1f9f6d..b2c1fc708 100644
--- a/packages/solid-query/src/__tests__/useIsMutating.test.tsx
+++ b/packages/solid-query/src/__tests__/useIsMutating.test.tsx
@@ -1,22 +1,22 @@
 import { fireEvent, screen, waitFor } from 'solid-testing-library'
-import {
-  createMutation,
-  QueryClient,
-  QueryClientProvider,
-  useIsMutating,
-} from '..'
-import { createQueryClient, sleep } from './utils'
 
 import {
+  ErrorBoundary,
+  Show,
   createContext,
   createEffect,
   createRenderEffect,
   createSignal,
-  ErrorBoundary,
-  Show,
 } from 'solid-js'
 import { render } from 'solid-testing-library'
+import {
+  QueryClient,
+  QueryClientProvider,
+  createMutation,
+  useIsMutating,
+} from '..'
 import * as MutationCacheModule from '../../../query-core/src/mutationCache'
+import { createQueryClient, sleep } from './utils'
 import { setActTimeout } from './utils'
 
 describe('useIsMutating', () => {
diff --git a/packages/solid-query/src/__tests__/utils.tsx b/packages/solid-query/src/__tests__/utils.tsx
index 41c904f12..212a023a4 100644
--- a/packages/solid-query/src/__tests__/utils.tsx
+++ b/packages/solid-query/src/__tests__/utils.tsx
@@ -1,7 +1,7 @@
-import type { QueryClientConfig } from '@tanstack/query-core'
 import { QueryClient } from '@tanstack/query-core'
+import { Show, createEffect, createSignal, onCleanup } from 'solid-js'
+import type { QueryClientConfig } from '@tanstack/query-core'
 import type { ParentProps } from 'solid-js'
-import { createEffect, createSignal, onCleanup, Show } from 'solid-js'
 
 let queryKeyCount = 0
 export function queryKey(): () => Array<string> {
diff --git a/packages/svelte-query/src/__tests__/createMutation.test.ts b/packages/svelte-query/src/__tests__/createMutation.test.ts
index bc124f0a7..1c302ec36 100644
--- a/packages/svelte-query/src/__tests__/createMutation.test.ts
+++ b/packages/svelte-query/src/__tests__/createMutation.test.ts
@@ -1,4 +1,4 @@
-import { describe, it, expect, vi } from 'vitest'
+import { describe, expect, it, vi } from 'vitest'
 import { fireEvent, render, waitFor } from '@testing-library/svelte'
 import CreateMutation from './CreateMutation.svelte'
 
diff --git a/packages/svelte-query/src/__tests__/createQueries.test.ts b/packages/svelte-query/src/__tests__/createQueries.test.ts
index c153b4863..0a4c510ee 100644
--- a/packages/svelte-query/src/__tests__/createQueries.test.ts
+++ b/packages/svelte-query/src/__tests__/createQueries.test.ts
@@ -1,4 +1,4 @@
-import { describe, it, expect } from 'vitest'
+import { describe, expect, it } from 'vitest'
 import { render, waitFor } from '@testing-library/svelte'
 import CreateQueries from './CreateQueries.svelte'
 import { sleep } from './utils'
diff --git a/packages/svelte-query/src/__tests__/createQuery.test.ts b/packages/svelte-query/src/__tests__/createQuery.test.ts
index ce438d613..454c99e73 100644
--- a/packages/svelte-query/src/__tests__/createQuery.test.ts
+++ b/packages/svelte-query/src/__tests__/createQuery.test.ts
@@ -1,4 +1,4 @@
-import { describe, it, expect } from 'vitest'
+import { describe, expect, it } from 'vitest'
 import { render, waitFor } from '@testing-library/svelte'
 import CreateQuery from './CreateQuery.svelte'
 import { sleep } from './utils'
diff --git a/packages/svelte-query/src/__tests__/utils.ts b/packages/svelte-query/src/__tests__/utils.ts
index bbdcf88a9..8c7bc9cdf 100644
--- a/packages/svelte-query/src/__tests__/utils.ts
+++ b/packages/svelte-query/src/__tests__/utils.ts
@@ -1,9 +1,9 @@
 import { vi } from 'vitest'
 import { act } from '@testing-library/svelte'
 import {
+  type MutationOptions,
   QueryClient,
   type QueryClientConfig,
-  type MutationOptions,
 } from '../index'
 
 export function createQueryClient(config?: QueryClientConfig): QueryClient {
diff --git a/packages/vue-query/src/__tests__/useInfiniteQuery.test.ts b/packages/vue-query/src/__tests__/useInfiniteQuery.test.ts
index f887f3ce1..b20ea5658 100644
--- a/packages/vue-query/src/__tests__/useInfiniteQuery.test.ts
+++ b/packages/vue-query/src/__tests__/useInfiniteQuery.test.ts
@@ -1,5 +1,5 @@
-import { infiniteFetcher, flushPromises } from './test-utils'
 import { useInfiniteQuery } from '../useInfiniteQuery'
+import { flushPromises, infiniteFetcher } from './test-utils'
 
 jest.mock('../useQueryClient')
 
diff --git a/packages/vue-query/src/__tests__/useIsFetching.test.ts b/packages/vue-query/src/__tests__/useIsFetching.test.ts
index d90be4cf6..753730a9f 100644
--- a/packages/vue-query/src/__tests__/useIsFetching.test.ts
+++ b/packages/vue-query/src/__tests__/useIsFetching.test.ts
@@ -1,8 +1,8 @@
 import { onScopeDispose, reactive, ref } from 'vue-demi'
 
-import { flushPromises, simpleFetcher } from './test-utils'
 import { useQuery } from '../useQuery'
 import { parseFilterArgs, useIsFetching } from '../useIsFetching'
+import { flushPromises, simpleFetcher } from './test-utils'
 
 jest.mock('../useQueryClient')
 
diff --git a/packages/vue-query/src/__tests__/useIsMutating.test.ts b/packages/vue-query/src/__tests__/useIsMutating.test.ts
index afc96654e..91b2df01f 100644
--- a/packages/vue-query/src/__tests__/useIsMutating.test.ts
+++ b/packages/vue-query/src/__tests__/useIsMutating.test.ts
@@ -1,9 +1,9 @@
 import { onScopeDispose, reactive, ref } from 'vue-demi'
 
-import { flushPromises, successMutator } from './test-utils'
 import { useMutation } from '../useMutation'
 import { parseFilterArgs, useIsMutating } from '../useIsMutating'
 import { useQueryClient } from '../useQueryClient'
+import { flushPromises, successMutator } from './test-utils'
 
 jest.mock('../useQueryClient')
 
diff --git a/packages/vue-query/src/__tests__/useMutation.test.ts b/packages/vue-query/src/__tests__/useMutation.test.ts
index 67e4e85ab..91a58309e 100644
--- a/packages/vue-query/src/__tests__/useMutation.test.ts
+++ b/packages/vue-query/src/__tests__/useMutation.test.ts
@@ -1,7 +1,7 @@
 import { reactive, ref } from 'vue-demi'
-import { errorMutator, flushPromises, successMutator } from './test-utils'
 import { parseMutationArgs, useMutation } from '../useMutation'
 import { useQueryClient } from '../useQueryClient'
+import { errorMutator, flushPromises, successMutator } from './test-utils'
 
 jest.mock('../useQueryClient')
 
diff --git a/packages/vue-query/src/__tests__/useQueries.test.ts b/packages/vue-query/src/__tests__/useQueries.test.ts
index 2ad58f355..194626504 100644
--- a/packages/vue-query/src/__tests__/useQueries.test.ts
+++ b/packages/vue-query/src/__tests__/useQueries.test.ts
@@ -1,14 +1,14 @@
 import { onScopeDispose, reactive } from 'vue-demi'
 
+import { useQueries } from '../useQueries'
+import { useQueryClient } from '../useQueryClient'
+import { QueryClient } from '../queryClient'
 import {
   flushPromises,
+  getSimpleFetcherWithReturnData,
   rejectFetcher,
   simpleFetcher,
-  getSimpleFetcherWithReturnData,
 } from './test-utils'
-import { useQueries } from '../useQueries'
-import { useQueryClient } from '../useQueryClient'
-import { QueryClient } from '../queryClient'
 
 jest.mock('../useQueryClient')
 
diff --git a/packages/vue-query/src/__tests__/useQuery.test.ts b/packages/vue-query/src/__tests__/useQuery.test.ts
index 7bb51a660..dfe473843 100644
--- a/packages/vue-query/src/__tests__/useQuery.test.ts
+++ b/packages/vue-query/src/__tests__/useQuery.test.ts
@@ -1,20 +1,20 @@
 import {
   computed,
+  getCurrentInstance,
+  onScopeDispose,
   reactive,
   ref,
-  onScopeDispose,
-  getCurrentInstance,
 } from 'vue-demi'
 import { QueryObserver } from '@tanstack/query-core'
 
+import { useQuery } from '../useQuery'
+import { parseQueryArgs, useBaseQuery } from '../useBaseQuery'
 import {
   flushPromises,
+  getSimpleFetcherWithReturnData,
   rejectFetcher,
   simpleFetcher,
-  getSimpleFetcherWithReturnData,
 } from './test-utils'
-import { useQuery } from '../useQuery'
-import { parseQueryArgs, useBaseQuery } from '../useBaseQuery'
 
 jest.mock('../useQueryClient')
 jest.mock('../useBaseQuery')
diff --git a/packages/vue-query/src/__tests__/utils.test.ts b/packages/vue-query/src/__tests__/utils.test.ts
index 0b88356d4..f4fad4d9a 100644
--- a/packages/vue-query/src/__tests__/utils.test.ts
+++ b/packages/vue-query/src/__tests__/utils.test.ts
@@ -1,5 +1,5 @@
-import { isQueryKey, updateState, cloneDeep, cloneDeepUnref } from '../utils'
 import { reactive, ref } from 'vue-demi'
+import { cloneDeep, cloneDeepUnref, isQueryKey, updateState } from '../utils'
 
 describe('utils', () => {
   describe('isQueryKey', () => {
diff --git a/packages/vue-query/src/__tests__/vueQueryPlugin.test.ts b/packages/vue-query/src/__tests__/vueQueryPlugin.test.ts
index 0902778af..c7a90d3d9 100644
--- a/packages/vue-query/src/__tests__/vueQueryPlugin.test.ts
+++ b/packages/vue-query/src/__tests__/vueQueryPlugin.test.ts
@@ -1,13 +1,13 @@
-import type { App, ComponentOptions } from 'vue'
 import { isVue2, isVue3, ref } from 'vue-demi'
 
 import { QueryClient } from '../queryClient'
 import { VueQueryPlugin } from '../vueQueryPlugin'
 import { VUE_QUERY_CLIENT } from '../utils'
 import { setupDevtools } from '../devtools/devtools'
-import { flushPromises } from './test-utils'
 import { useQuery } from '../useQuery'
 import { useQueries } from '../useQueries'
+import { flushPromises } from './test-utils'
+import type { App, ComponentOptions } from 'vue'
 
 jest.mock('../devtools/devtools')
 jest.mock('../useQueryClient')