You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework/react/guides/migrating-to-react-query-4.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,8 +65,8 @@ However, we have not followed this concept through to all apis. For example, whe
65
65
To streamline all apis, we've decided to make all keys Arrays only:
66
66
67
67
```tsx
68
-
-useQuery('todos', fetchTodos) // [!code --]
69
-
+useQuery(['todos'], fetchTodos) // [!code ++]
68
+
;-useQuery('todos', fetchTodos)+// [!code --]
69
+
useQuery(['todos'], fetchTodos) // [!code ++]
70
70
```
71
71
72
72
#### Codemod
@@ -117,8 +117,8 @@ Also, have a look at [the guide on dependent queries](../dependent-queries)
117
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
118
119
119
```tsx
120
-
-isLoading// [!code --]
121
-
+isInitialLoading// [!code ++]
120
+
;-isLoading+// [!code --]
121
+
isInitialLoading// [!code ++]
122
122
```
123
123
124
124
See also the guide on [disabling queries](../disabling-queries#isInitialLoading)
@@ -128,8 +128,16 @@ See also the guide on [disabling queries](../disabling-queries#isInitialLoading)
128
128
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