Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shy-wings-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/query-core': patch
---

Fix bugs where hydrating queries with promises that had already resolved could cause queries to briefly and incorrectly show as pending/fetching
4 changes: 2 additions & 2 deletions docs/eslint/no-unstable-deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Examples of **incorrect** code for this rule:

```tsx
/* eslint "@tanstack/query/no-unstable-deps": "warn" */
import { useCallback } from 'React'
import { useCallback } from 'react'
import { useMutation } from '@tanstack/react-query'

function Component() {
Expand All @@ -38,7 +38,7 @@ Examples of **correct** code for this rule:

```tsx
/* eslint "@tanstack/query/no-unstable-deps": "warn" */
import { useCallback } from 'React'
import { useCallback } from 'react'
import { useMutation } from '@tanstack/react-query'

function Component() {
Expand Down
5 changes: 3 additions & 2 deletions docs/framework/react/reference/useQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ const {
- If set to a `number`, e.g. `3`, failed queries will retry until the failed query count meets that number.
- If set to a function, it will be called with `failureCount` (starting at `0` for the first retry) and `error` to determine if a retry should be attempted.
- defaults to `3` on the client and `0` on the server
- `retryOnMount: boolean`
- If set to `false`, the query will not be retried on mount if it contains an error. Defaults to `true`.
- `retryOnMount: boolean | (query: Query) => boolean`
- If set to `false`, the query will not be retried on mount if it contains an error and has no data. Defaults to `true`.
- If set to a function, the function will be executed with the query to compute the value.
- `retryDelay: number | (retryAttempt: number, error: TError) => number`
- This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds.
- A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential backoff.
Expand Down
5 changes: 3 additions & 2 deletions docs/framework/solid/reference/useQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ function App() {
- If `true`, failed queries will retry infinitely.
- If set to a `number`, e.g. `3`, failed queries will retry until the failed query count meets that number.
- defaults to `3` on the client and `0` on the server
- ##### `retryOnMount: boolean`
- If set to `false`, the query will not be retried on mount if it contains an error. Defaults to `true`.
- ##### `retryOnMount: boolean | (query: Query) => boolean`
- If set to `false`, the query will not be retried on mount if it contains an error and has no data. Defaults to `true`.
- If set to a function, the function will be executed with the query to compute the value.
- ##### `retryDelay: number | (retryAttempt: number, error: TError) => number`
- This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds.
- A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential backoff.
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/auto-refetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
6 changes: 3 additions & 3 deletions examples/angular/basic-persister/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-persist-client": "^5.99.2",
"@tanstack/query-async-storage-persister": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"@tanstack/angular-query-persist-client": "^5.100.0",
"@tanstack/query-async-storage-persister": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/devtools-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@angular/router": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/optimistic-updates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/core": "^20.0.0",
"@angular/forms": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/query-options-from-a-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@angular/router": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@angular/router": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/rxjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/core": "^20.0.0",
"@angular/forms": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@tanstack/angular-query-experimental": "^5.99.2",
"@tanstack/angular-query-experimental": "^5.100.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/preact/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/preact-query": "^5.99.2",
"@tanstack/preact-query": "^5.100.0",
"preact": "^10.28.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions examples/react/algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
},
"dependencies": {
"@algolia/client-search": "5.2.1",
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.99.2",
"@tanstack/eslint-plugin-query": "^5.100.0",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.4",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/auto-refetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/react/basic-graphql-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"graphql": "^16.9.0",
"graphql-request": "^7.1.2",
"react": "^19.0.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"test:eslint": "eslint ./src"
},
"dependencies": {
"@tanstack/query-async-storage-persister": "^5.99.2",
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query-persist-client": "^5.99.2",
"@tanstack/query-async-storage-persister": "^5.100.0",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"@tanstack/react-query-persist-client": "^5.100.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.99.2",
"@tanstack/eslint-plugin-query": "^5.100.0",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.4",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/react/default-query-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/react/devtools-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down
10 changes: 5 additions & 5 deletions examples/react/eslint-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"test:eslint": "ESLINT_USE_FLAT_CONFIG=false eslint ./src/**/*.tsx"
},
"dependencies": {
"@tanstack/query-async-storage-persister": "^5.99.2",
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query-persist-client": "^5.99.2",
"@tanstack/query-async-storage-persister": "^5.100.0",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"@tanstack/react-query-persist-client": "^5.100.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.99.2",
"@tanstack/eslint-plugin-query": "^5.100.0",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.4",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/eslint-plugin-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"test:eslint": "eslint ./src"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"react": "^19.0.0"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.99.2",
"@tanstack/eslint-plugin-query": "^5.100.0",
"eslint": "^9.39.0",
"typescript": "5.8.3",
"typescript-eslint": "^8.48.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/react/infinite-query-with-max-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/react/load-more-infinite-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/nextjs-app-prefetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
6 changes: 3 additions & 3 deletions examples/react/nextjs-suspense-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query-next-experimental": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"@tanstack/react-query-next-experimental": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/react/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
8 changes: 4 additions & 4 deletions examples/react/offline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/query-async-storage-persister": "^5.99.2",
"@tanstack/query-async-storage-persister": "^5.100.0",
"@tanstack/react-location": "^3.7.4",
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query-persist-client": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"@tanstack/react-query-persist-client": "^5.100.0",
"msw": "^2.6.6",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/optimistic-updates-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/react/optimistic-updates-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/react/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tanstack/react-query": "^5.99.2",
"@tanstack/react-query-devtools": "^5.99.2",
"@tanstack/react-query": "^5.100.0",
"@tanstack/react-query-devtools": "^5.100.0",
"next": "^16.0.7",
"react": "^19.2.1",
"react-dom": "^19.2.1"
Expand Down
Loading
Loading