Skip to content

Commit b53b413

Browse files
committed
docs: add a section about isInitialLoading to the migration guide
1 parent a9dd364 commit b53b413

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ This will mostly affect `disabled` queries that don't have any `data` yet, as th
112112

113113
Also, have a look at [the guide on dependent queries](../guides/dependent-queries)
114114

115+
#### disabled queries
116+
117+
Due to this change, disabled queries (even temporarily disabled ones) will start in `loading` state. To make migration easier, especially for having a good flag to know when to display a loading spinner, you can check for `isInitialLoading` instead of `isLoading`:
118+
119+
```diff
120+
- isLoading
121+
+ isInitialLoading
122+
```
123+
124+
See also the guide on [disabling queries](../guides/disabling-queries#isInitialLoading)
125+
115126
### new API for `useQueries`
116127

117128
The `useQueries` hook now accepts an object with a `queries` prop as its input. The value of the `queries` prop is an array of queries (this array is identical to what was passed into `useQueries` in v3).

0 commit comments

Comments
 (0)