Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
ccc843e
test({react,preact}-query/useQueries): move type-only tests to 'useQu…
sukvvon Jun 16, 2026
784c2f0
test(solid-query/useQueries): move type-only tests to 'useQueries.tes…
sukvvon Jun 16, 2026
84dbefa
test(solid-query/useQuery): move type-only test to 'useQuery.test-d.t…
sukvvon Jun 16, 2026
18d4504
test(solid-query/useQuery): add type test for generic indexed-access …
sukvvon Jun 16, 2026
835a299
test(vue-query/useMutation): replace 'vi.waitFor' with 'vi.advanceTim…
sukvvon Jun 17, 2026
a7b783a
test(vue-query): replace deprecated 'toBeCalledWith' with 'toHaveBeen…
sukvvon Jun 17, 2026
0bed37a
test(query-core): replace deprecated 'toBeCalledWith' and 'toBeCalled…
sukvvon Jun 17, 2026
4f11927
docs(angular-query): fix "allows to" grammar in JSDoc comments (#10890)
dfedoryshchev Jun 19, 2026
9eff92e
fix(hydration): set dataUpdatedAt when pending query resolves before …
DoriAlagem Jun 23, 2026
c28b2f9
ci: apply automated fixes
autofix-ci[bot] Jun 23, 2026
b809297
ci: Version Packages (#10977)
github-actions[bot] Jun 23, 2026
982c618
test(svelte-query/utils): add tests for 'watchChanges' first-run skip…
sukvvon Jun 24, 2026
4eb0ed9
chore: update pnpm to 11.9.0 (#10978)
Sheraff Jun 24, 2026
0298c90
test(query-core): keep setQueryData typecheck green on TypeScript 5.4…
manudeli Jun 25, 2026
fcdcf8a
fix(svelte-query/containers): fix typo from 'Tanstack' to 'TanStack' …
parkhojeong Jun 25, 2026
e6ad3fc
fix(release): avoid pre dist tag for prereleases (#10986)
brenelz Jun 26, 2026
0b6b827
test(svelte-query/containers): add test for deleting a non-existent p…
sukvvon Jun 27, 2026
1f84256
docs: document the `select` typing caveat for parallel-queries hooks …
manudeli Jun 27, 2026
fd495f2
docs: add @codewithagents/openapi-react-query to community resources …
benjamineckstein Jun 27, 2026
ac7a42d
docs(svelte): replace deprecated isLoading with isPending in overview…
poetryofcode Jun 27, 2026
661c1af
docs(preact): add polling guide (#10991)
poetryofcode Jun 27, 2026
b03390b
docs: add Deno to installation instructions (#10971)
bartlomieju Jun 27, 2026
9cb8eac
fix: lit produces dist-js which needs to be a prod build output (#10995)
TkDodo Jun 27, 2026
25cdd97
fix(query-devtools/utils): make 'last updated' sort return 0 for quer…
sukvvon Jun 27, 2026
f5bf180
fix(query-devtools/PiPContext): reset 'pip_open' in 'localStore' from…
sukvvon Jun 27, 2026
01c7634
fix(query-devtools/Devtools): correct the Theme sub-trigger className…
sukvvon Jun 27, 2026
ecd89c8
fix(query-devtools/utils): scope the 'setupStyleSheet' dedup check to…
sukvvon Jun 27, 2026
ceec8f0
fix(devtools): add transform: translateZ(0) for Safari overflow rende…
lihan3238 Jun 27, 2026
ad57c81
docs(devtools): make markdown consistent (#10987)
dborysov Jun 27, 2026
a4587b6
test(query-core/hydration): replace 'vi.waitFor' with 'vi.advanceTime…
sukvvon Jun 27, 2026
49012db
fix(query-devtools): set window.__nonce__ in setupStyleSheet (#10736)
842u Jun 27, 2026
610e8d1
ci: Version Packages (#10996)
github-actions[bot] Jun 27, 2026
41b775f
test(query-core/queryObserver): add test for pending state with a syn…
sukvvon Jun 29, 2026
8d979da
test(angular-query/devtools): add test for reactive 'theme' update (#…
sukvvon Jun 29, 2026
d6798b5
docs(angular-query/devtools): add the 'theme' option (#11002)
sukvvon Jun 29, 2026
cb115ea
test(react-query-devtools/ReactQueryDevtools): add tests for forwardi…
sukvvon Jul 3, 2026
6ec2ebc
test(preact-query-devtools/PreactQueryDevtools): add tests for forwar…
sukvvon Jul 3, 2026
be8f11b
test(solid-query-devtools/devtools): add tests for forwarding option …
sukvvon Jul 3, 2026
6a5bc45
test(react-query-devtools): extract shared test setup into 'beforeEac…
sukvvon Jul 4, 2026
ee301ad
test(preact-query-devtools): extract shared test setup into 'beforeEa…
sukvvon Jul 4, 2026
27e680f
test(solid-query-devtools): extract shared test setup into 'beforeEac…
sukvvon Jul 4, 2026
c476781
test({react,preact}-query-devtools): assert the forwarded 'onClose' c…
sukvvon Jul 4, 2026
bb68fa0
test(solid-query-devtools/devtoolsPanel): assert the default 'onClose…
sukvvon Jul 4, 2026
64241b8
test(query-core/{hydration,queriesObserver}): remove unnecessary 'asy…
sukvvon Jul 8, 2026
dea3698
test(query-core): assert exact booleans with 'toBe' instead of 'toBeT…
sukvvon Jul 11, 2026
bd07339
test(solid-query-persist-client/PersistQueryClientProvider): replace …
sukvvon Jul 11, 2026
969772d
test(query-core/hydration): assert the exact infinite query result wi…
sukvvon Jul 11, 2026
f79938e
test(vue-query/useQueries): replace 'toMatchObject' with 'toEqual' (#…
sukvvon Jul 11, 2026
7bc3415
test(solid-query-persist-client/PersistQueryClientProvider): use 'toS…
sukvvon Jul 11, 2026
0cdfdea
test(query-core/utils,vue-query/mutationOptions): assert reference id…
sukvvon Jul 11, 2026
72e90c8
test(vue-query/vueQueryPlugin): assert exact booleans with 'toBe' ins…
sukvvon Jul 11, 2026
0a852e0
test({react,preact,solid}-query/useMutation): improve callback assert…
sukvvon Jul 11, 2026
aa1f9d7
test({vue,angular}-query): pin the reactive refetch call with 'toHave…
sukvvon Jul 12, 2026
8773a15
test(query-devtools/PiPContext): assert exact spy arguments instead o…
sukvvon Jul 12, 2026
b2ce5bc
test(query-core): assert exact cache event payloads in subscribe call…
sukvvon Jul 12, 2026
fb8f474
test(vue-query/{usePrefetchQuery,usePrefetchInfiniteQuery}): assert e…
sukvvon Jul 12, 2026
045c947
test(*): assert exact values instead of loose matchers (#11057)
sukvvon Jul 12, 2026
f6cf120
docs({react,solid}-query): add missing 'errorUpdateCount' to 'useQuer…
KangaZero Jul 12, 2026
79d2384
docs(*): fix 'homogenous', 'stoage', 'supressed', 'compoennts' spelli…
maxtaran2010 Jul 13, 2026
1d972e7
docs(CONTRIBUTING): update pnpm version from 'v10' to 'v11' (#11066)
kobihikri Jul 16, 2026
a9aa23f
test(query-core/utils): add tests for 'undefined' key properties and …
whizzkid1452 Jul 17, 2026
80b833e
test(query-core/utils): assert exact booleans with 'toBe' instead of …
sukvvon Jul 17, 2026
97db5d2
test(query-core/utils): split 'isValidTimeout' rejection cases into s…
sukvvon Jul 17, 2026
b9c657e
test({react,preact}-query/usePrefetchQuery): assert the 'Loading...' …
sukvvon Jul 18, 2026
b955f60
test({react,preact}-query/useSuspenseQuery): assert the 'loading' fal…
sukvvon Jul 18, 2026
dbd5a86
test({react,preact}-query/usePrefetchQuery): inline the shared 'Suspe…
sukvvon Jul 18, 2026
10770f0
test({react,preact}-query/usePrefetchInfiniteQuery): inline the share…
sukvvon Jul 18, 2026
99690d1
test({react,preact}-query/usePrefetchInfiniteQuery): inline single-us…
sukvvon Jul 18, 2026
d1558c1
test({react,preact}-query/usePrefetchQuery): inline the 'generateQuer…
sukvvon Jul 18, 2026
44f38df
test({react,preact,solid}-query/useInfiniteQuery): inline the shared …
sukvvon Jul 19, 2026
a42b8a3
test(query-core/queryObserver): use the '.then()' convention consiste…
sukvvon Jul 20, 2026
6d55b07
test({react,preact}-query): use the '.then()' convention consistently…
sukvvon Jul 20, 2026
ff24bf7
test(solid-query): use the '.then()' convention consistently (#11087)
sukvvon Jul 20, 2026
0a612ec
test(angular-query-persist-client): use the '.then()' convention cons…
sukvvon Jul 20, 2026
7e3c822
perf: special case arrays in partialMatchKey (#11084)
43081j Jul 20, 2026
181ea82
ci: Version Packages (#11089)
github-actions[bot] Jul 20, 2026
7ac45ed
fix(eslint-plugin-query): ignore call targets in exhaustive-deps (#11…
Newbie012 Jul 21, 2026
86bb8a6
ci: Version Packages (#11094)
github-actions[bot] Jul 21, 2026
98d2bfd
docs(CONTRIBUTING): link '.nvmrc' reference to the actual file (#11097)
Antoliny0919 Jul 24, 2026
a3b0612
test({react,preact}-query/usePrefetchQuery): use the '.then()' conven…
Antoliny0919 Jul 24, 2026
fd50fa1
ci: update renovate.json (#11114)
lachlancollins Jul 24, 2026
f320db5
test(solid-query): assert exact values instead of loose matchers (#11…
reizam Jul 26, 2026
3bf3adc
test(query-core): assert exact values instead of loose matchers in re…
reizam Jul 26, 2026
e330cee
test(angular-query): replace 'toBeDefined' with exact-value assertion…
sukvvon Jul 26, 2026
f99c105
test(lit-query): replace 'toBeDefined'/'toBeGreaterThan' with exact-v…
sukvvon Jul 26, 2026
fbe532c
test({react,preact}-query): replace 'toBeDefined'/'toBeFalsy' with ex…
sukvvon Jul 26, 2026
5972ae6
test(svelte-query): replace 'toBeDefined' with exact-value assertion …
sukvvon Jul 26, 2026
e396148
test(query-devtools/Devtools): add test for rendering a hydrated quer…
ckdwns9121 Jul 26, 2026
75b2d10
test(svelte-query/createQuery): replace 'toBeDefined' with exact-valu…
aken-you Jul 28, 2026
9d24c45
test(react-query/useQuery.promise): unskip 'cancelQueries' while susp…
sukvvon Jul 29, 2026
6efc619
docs(CONTRIBUTING): replace 'npm run test' and 'npx nx' commands with…
Antoliny0919 Aug 2, 2026
96fbd7d
docs(CONTRIBUTING): remove stale gitpod one-click setup section (#11096)
Antoliny0919 Aug 2, 2026
31c7f37
docs(angular-query): fix invalid imports and syntax error in guide ex…
meliharik Aug 2, 2026
46d7f02
docs: use the dynamic README header endpoint (#11136)
AlemTuzlak Aug 3, 2026
159982c
docs(react-query/useQuery): document 'throwOnError' default value (#1…
sukvvon Aug 12, 2026
19c7623
chore: upgrade to solid v2 rc, rename vite-plugin-solid, move branch …
brenelz Aug 12, 2026
7d8e9c4
Merge branch 'main' into chore/solid-v2-rc-main-merge
brenelz Aug 12, 2026
2f3dd76
Merge branch 'solid-query-v6-pre' into chore/solid-v2-rc-main-merge
brenelz Aug 12, 2026
9dbb8ca
Merge branch 'solid-query-v6-pre' into chore/solid-v2-rc-main-merge
brenelz Aug 12, 2026
606d09d
test(solid-query-devtools): stub devtools mount so the lazy UI import…
brenelz Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"configMigration": true,
"extends": [
"config:recommended",
"helpers:pinGitHubActionDigests",
"group:allNonMajor",
"schedule:weekly",
"security:minimumReleaseAgeNpm",
":approveMajorUpdates",
":automergeMinor",
":disablePeerDependencies",
":maintainLockFilesMonthly",
":semanticCommits",
Expand Down
30 changes: 5 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ If you have been assigned to fix an issue or develop a new feature, please follo
pnpm install
```

- We use [pnpm](https://pnpm.io/) v10 for package management (run in case of pnpm-related issues).
- We use [pnpm](https://pnpm.io/) v11 for package management (run in case of pnpm-related issues).

```bash
corepack enable && corepack prepare
```

- We use [nvm](https://github.com/nvm-sh/nvm) to manage node versions - please make sure to use the version mentioned in `.nvmrc`
- We use [nvm](https://github.com/nvm-sh/nvm) to manage node versions - please make sure to use the version mentioned in [.nvmrc](./.nvmrc)

```bash
nvm use
Expand Down Expand Up @@ -135,26 +135,6 @@ https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af27

If you want to run an example without installing dependencies for the whole repo, just follow the instructions from the example's README.md file. It will then be run against the latest TanStack Query release.

## Online one-click setup

You can use Gitpod (An Online open-source VS Code-like IDE that is free for Open Source) for developing online. With a single click it will start a workspace and automatically:

- clone the `TanStack/query` repo.
- install all the dependencies in `/` and `/docs`.
- run below in the root(`/`) to Auto-build files.

```bash
npm start
```

- run below in `/docs`.

```bash
npm run dev
```

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/query)

## Changesets

This repo uses [Changesets](https://github.com/changesets/changesets) to automate releases. If your PR should release a new package version (patch, minor, or major), please run `pnpm changeset` and commit the file. If needed, changeset descriptions can be more descriptive, and will be included in the changelog. If your PR affects docs, examples, styles, etc., you probably don't need to generate a changeset.
Expand All @@ -179,21 +159,21 @@ To run tests in a local environment, you should use `nx` commands from the root
To run tests for **all packages**, run:

```bash
npm run test
pnpm run test
```

### ✅ Run tests for a specific package

To run tests for a specific package, use the following command:

```bash
npx nx run @tanstack/{package-name}:test:lib
pnpm nx run @tanstack/{package-name}:test:lib
```

For example:

```bash
npx nx run @tanstack/react-query:test:lib
pnpm nx run @tanstack/react-query:test:lib
```

### ⚠️ Caution
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=be2d8a11-9712-4c1d-9963-580b2d4fb133" />

<div align="center">
<img src="./media/header_query.png" alt="TanStack Query" />
<picture>
<source
media="(prefers-color-scheme: dark)"
srcset="https://tanstack.com/api/readme/query.png?theme=dark"
/>
<source
media="(prefers-color-scheme: light)"
srcset="https://tanstack.com/api/readme/query.png"
/>
<img
src="https://tanstack.com/api/readme/query.png"
alt="TanStack Query"
width="900"
/>
</picture>
</div>

<br />
Expand Down
5 changes: 5 additions & 0 deletions docs/community-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ others:
url: 'https://www.kubb.dev/',
description: 'Generate SDKs for all your APIs',
},
{
title: '@codewithagents/openapi-react-query',
url: 'https://github.com/codewithagents/openapi-zod-ts',
description: 'Generate fully typed TanStack/React Query v5 hooks from an OpenAPI 3.1 spec, with Zod v4 runtime validation and an end-to-end pipeline (client, mocks, server).',
},
{
title: 'OpenAPI codegen',
url: 'https://github.com/fabien0102/openapi-codegen',
Expand Down
4 changes: 4 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,10 @@
"label": "Window Focus Refetching",
"to": "framework/preact/guides/window-focus-refetching"
},
{
"label": "Polling",
"to": "framework/preact/guides/polling"
},
{
"label": "Disabling/Pausing Queries",
"to": "framework/preact/guides/disabling-queries"
Expand Down
28 changes: 9 additions & 19 deletions docs/eslint/exhaustive-deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ id: exhaustive-deps
title: Exhaustive dependencies for query keys
---

Query keys should be seen like a dependency array to your query function: Every variable that is used inside the queryFn should be added to the query key.
This makes sure that queries are cached independently and that queries are refetched automatically when the variables changes.
Query keys should contain the serializable values that identify the data returned by your queryFn.
This makes sure that queries are cached independently and that queries are refetched automatically when those values change.

Function call targets are not query key dependencies. For example, `fetchTodoById(todoId)` needs `todoId` in the query key, but not `fetchTodoById`. Values referenced inside nested callbacks are still dependencies, so `promise.then(() => todoId)` also needs `todoId` in the query key.

## Rule Details

Expand All @@ -29,7 +31,7 @@ Examples of **correct** code for this rule:
const Component = ({ todoId }) => {
const todos = useTodos()
useQuery({
queryKey: ['todo', todos, todoId],
queryKey: ['todo', todoId],
queryFn: () => todos.getTodo(todoId),
})
}
Expand All @@ -46,24 +48,12 @@ const todoQueries = {
```

```tsx
// with { allowlist: { variables: ["todos"] }}
const Component = ({ todoId }) => {
const todos = useTodos()
useQuery({
queryKey: ['todo', todoId],
queryFn: () => todos.getTodo(todoId),
})
}
```

```tsx
// with { allowlist: { types: ["TodosClient"] }}
class TodosClient { ... }
const Component = ({ todoId }) => {
const todos: TodosClient = new TodosClient()
// with { allowlist: { types: ["Config"] }}
class Config { ... }
const Component = ({ todoId, config }: { todoId: string, config: Config }) => {
useQuery({
queryKey: ['todo', todoId],
queryFn: () => todos.getTodo(todoId),
queryFn: () => fetchTodo(todoId, config.baseUrl),
})
}
```
Expand Down
11 changes: 7 additions & 4 deletions docs/framework/angular/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ title: Devtools

> For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
>
> - <img alt="Chrome logo" src="https://www.google.com/chrome/static/images/chrome-logo.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Chrome](https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai)
> - <img alt="Firefox logo" src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Firefox](https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/)
> - <img alt="Edge logo" src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Edge](https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj)
> - <img alt="Chrome logo" src="https://www.google.com/chrome/static/images/chrome-logo.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai">Devtools for Chrome</a>
> - <img alt="Firefox logo" src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/">Devtools for Firefox</a>
> - <img alt="Edge logo" src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj">Devtools for Edge</a>

## Enable devtools

Expand Down Expand Up @@ -137,7 +137,7 @@ export const appConfig: ApplicationConfig = {

### Options returned from the callback

Of these options `loadDevtools`, `client`, `position`, `errorTypes`, `buttonPosition`, and `initialIsOpen` support reactivity through signals.
Of these options `loadDevtools`, `client`, `position`, `errorTypes`, `buttonPosition`, `initialIsOpen`, and `theme` support reactivity through signals.

- `loadDevtools?: 'auto' | boolean`
- Defaults to `auto`: lazily loads devtools when in development mode. Skips loading in production mode.
Expand All @@ -162,3 +162,6 @@ Of these options `loadDevtools`, `client`, `position`, `errorTypes`, `buttonPosi
- Use this to pass a shadow DOM target to the devtools so that the styles will be applied within the shadow DOM instead of within the head tag in the light DOM.
- `hideDisabledQueries?: boolean`
- Set this to true to hide disabled queries from the devtools panel.
- `theme?: "light" | "dark" | "system"`
- Defaults to `system`.
- Set this to change the theme of the devtools panel.
2 changes: 1 addition & 1 deletion docs/framework/angular/guides/disabling-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class TodosComponent {
[//]: # 'Example3'

```angular-ts
import { skipToken, injectQuery } from '@tanstack/query-angular'
import { skipToken, injectQuery } from '@tanstack/angular-query-experimental'
@Component({
selector: 'todos',
Expand Down
5 changes: 4 additions & 1 deletion docs/framework/angular/guides/query-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ ref: docs/framework/react/guides/query-functions.md

```ts
injectQuery(() => ({ queryKey: ['todos'], queryFn: fetchAllTodos }))
injectQuery(() => ({ queryKey: ['todos', todoId], queryFn: () => fetchTodoById(todoId) })
injectQuery(() => ({
queryKey: ['todos', todoId],
queryFn: () => fetchTodoById(todoId),
}))
injectQuery(() => ({
queryKey: ['todos', todoId],
queryFn: async () => {
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/angular/guides/query-retries.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const result = injectQuery(() => ({
import {
QueryCache,
QueryClient,
QueryClientProvider,
provideTanStackQuery,
} from '@tanstack/angular-query-experimental'

const queryClient = new QueryClient({
Expand Down
6 changes: 3 additions & 3 deletions docs/framework/preact/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ When you begin your Preact Query journey, you'll want these devtools by your sid

> For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
>
> - <img alt="Chrome logo" src="https://www.google.com/chrome/static/images/chrome-logo.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Chrome](https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai)
> - <img alt="Firefox logo" src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Firefox](https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/)
> - <img alt="Edge logo" src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Edge](https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj)
> - <img alt="Chrome logo" src="https://www.google.com/chrome/static/images/chrome-logo.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai">Devtools for Chrome</a>
> - <img alt="Firefox logo" src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/">Devtools for Firefox</a>
> - <img alt="Edge logo" src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj">Devtools for Edge</a>

## Install and Import the Devtools

Expand Down
6 changes: 6 additions & 0 deletions docs/framework/preact/guides/polling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: polling
title: Polling
ref: docs/framework/react/guides/polling.md
replace: { '@tanstack/react-query': '@tanstack/preact-query' }
---
6 changes: 3 additions & 3 deletions docs/framework/react/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ When you begin your React Query journey, you'll want these devtools by your side

> For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
>
> - <img alt="Chrome logo" src="https://www.google.com/chrome/static/images/chrome-logo.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Chrome](https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai)
> - <img alt="Firefox logo" src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Firefox](https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/)
> - <img alt="Edge logo" src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg" width="16" height="16" class="inline mr-1 not-prose" /> [Devtools for Edge](https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj)
> - <img alt="Chrome logo" src="https://www.google.com/chrome/static/images/chrome-logo.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai">Devtools for Chrome</a>
> - <img alt="Firefox logo" src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/">Devtools for Firefox</a>
> - <img alt="Edge logo" src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg" width="16" height="16" class="inline mr-1 not-prose" /> <a href="https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj">Devtools for Edge</a>

> For React Native users: A third-party native macOS app is available for debugging React Query in ANY js-based application. Monitor queries across devices in real-time. Check it out here: [rn-better-dev-tools](https://github.com/LovesWorking/rn-better-dev-tools)

Expand Down
5 changes: 5 additions & 0 deletions docs/framework/react/guides/parallel-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ function App({ users }) {
```

[//]: # 'Example2'
[//]: # 'TypeScriptSelect'

> When using TypeScript, an inline `select` written on a query object passed to `useQueries` can't infer its `data` argument from that same object's `queryFn` — it falls back to `unknown`. Annotate the `select` parameter explicitly, or define the query with the [`queryOptions`](../reference/queryOptions.md) helper, to keep type inference. See [this known limitation](https://github.com/TanStack/query/issues/6556).

[//]: # 'TypeScriptSelect'
6 changes: 6 additions & 0 deletions docs/framework/react/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ or
bun add @tanstack/react-query
```

or

```bash
deno add @tanstack/react-query
```

[//]: # 'Compatibility'

React Query is compatible with React v18+ and works with ReactDOM and React Native.
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/plugins/createPersister.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ If `query` is `expired`, `busted` or `malformed` it would be removed from the st

### `persisterGc(): Promise<void>`

This function can be used to sporadically clean up stoage from `expired`, `busted` or `malformed` entries.
This function can be used to sporadically clean up storage from `expired`, `busted` or `malformed` entries.

For this function to work, your storage must expose `entries` method that would return a `key-value tuple array`.
For example `Object.entries(localStorage)` for `localStorage` or `entries` from `idb-keyval`.
Expand Down
78 changes: 78 additions & 0 deletions docs/framework/react/reference/useQueries.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,81 @@ The `combine` function will only re-run if:
- any of the query results changed

This means that an inlined `combine` function, as shown above, will run on every render. To avoid this, you can wrap the `combine` function in `useCallback`, or extract it to a stable function reference if it doesn't have any dependencies.

## TypeScript: typing the `select` option

Unlike `useQuery`, `useQueries` cannot infer the `data` argument of an _inline_ `select` from its sibling `queryFn`. Because `useQueries` infers the type of the whole `queries` array at once, the `select` parameter of a query object written inline cannot be contextually typed from that same object's `queryFn`, so it falls back to `unknown`. This is a [known TypeScript limitation](https://github.com/TanStack/query/issues/6556).

```tsx
useQueries({
queries: [
{
queryKey: ['post', 1],
queryFn: () => fetchPost(1),
// ❌ `data` is `unknown` here
select: (data) => data.title,
},
],
})
```

There are two supported workarounds:

1. Annotate the `select` parameter explicitly:

```tsx
useQueries({
queries: [
{
queryKey: ['post', 1],
queryFn: () => fetchPost(1),
// ✅ `data` is `Post`
select: (data: Post) => data.title,
},
],
})
```

2. Define the query with the [`queryOptions`](./queryOptions.md) helper, which resolves its types in a single object _before_ it reaches `useQueries`:

```tsx
const postOptions = (id: number) =>
queryOptions({
queryKey: ['post', id],
queryFn: () => fetchPost(id),
// ✅ `data` is `Post`
select: (data) => data.title,
})

useQueries({ queries: [postOptions(1), postOptions(2)] })
```

The same limitation applies when you spread a `queryOptions` result to override its `select` inline — the overriding `select` still falls back to `unknown`:

```tsx
useQueries({
queries: [
{
...postOptions(1),
// ❌ `data` is `unknown` here
select: (data) => data.title,
},
],
})
```

Wrap the spread in `queryOptions` again so the override is resolved before it reaches `useQueries`:

```tsx
useQueries({
queries: [
queryOptions({
...postOptions(1),
// ✅ `data` is `Post`
select: (data) => data.title,
}),
],
})
```

The same applies to [`useSuspenseQueries`](./useSuspenseQueries.md).
3 changes: 3 additions & 0 deletions docs/framework/react/reference/useQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {
data,
dataUpdatedAt,
error,
errorUpdateCount,
errorUpdatedAt,
failureCount,
failureReason,
Expand Down Expand Up @@ -171,6 +172,8 @@ const {
- Defaults to `true`
- If set to `false`, this instance of `useQuery` will not be subscribed to the cache. This means it won't trigger the `queryFn` on its own, and it won't receive updates if data gets into cache by other means.
- `throwOnError: undefined | boolean | (error: TError, query: Query) => boolean`
- Optional
- Defaults to `false`
- Set this to `true` if you want errors to be thrown in the render phase and propagate to the nearest error boundary
- Set this to `false` to disable `suspense`'s default behavior of throwing errors to the error boundary.
- If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`)
Expand Down
Loading
Loading