Skip to content

Commit cba4503

Browse files
committed
docs: idle state is removed
1 parent 1b91f3f commit cba4503

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

docs/src/pages/guides/migrating-to-react-query-4.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ It was possible to change the logger globally by calling `setLogger`. In v4, tha
282282
+ const queryClient = new QueryClient({ logger: customLogger })
283283
```
284284

285-
### Undefined is an illegale cache value for successful queries
285+
### Undefined is an illegal cache value for successful queries
286286

287287
In order to make bailing out of updates possible by returning `undefined`, we had to make `undefined` an illegal cache value. This is in-line with other concepts of react-query, for example, returning `undefined` from the [initialData function](guides/initial-query-data#initial-data-function) will also _not_ set data.
288288

@@ -301,6 +301,20 @@ This is now disallowed on type level; at runtime, `undefined` will be transforme
301301

302302
As of v4, React Query is optimized for modern browsers. We have updated our browserslist to produce a more modern, performant and smaller bundle. You can read about the requirements [here](../installation#requirements).
303303

304+
### The idle state has been removed
305+
306+
With the introduction of the new [fetchStatus](../guides/queries#fetchstatus) for better offline support, the `idle` state became irrelevant, because `fetchStatus: 'idle'` captures the same state better. For more information, please read [Why two different states](../guides/queries#why-two-different-states).
307+
308+
This will mostly affect `disabled` queries that don't have any `data` yet, as those were in `idle` state before:
309+
310+
```diff
311+
- status: 'idle'
312+
+ status: 'loading'
313+
+ fetchStatus: 'idle'
314+
```
315+
316+
Also, have a look at [the guide on dependent queries](../guides/dependent-queries)
317+
304318
## New Features 🚀
305319

306320
### Proper offline support

docs/src/pages/reference/useQuery.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const {
1515
isFetchedAfterMount,
1616
isFetching,
1717
isPaused,
18-
isIdle,
1918
isLoading,
2019
isLoadingError,
2120
isPlaceholderData,

0 commit comments

Comments
 (0)