Skip to content

Commit 7cdf3cb

Browse files
committed
feat(hydration): update docs
1 parent 3813c37 commit 7cdf3cb

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

docs/src/manifests/manifest.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@
204204
"title": "Migrating to React Query 3",
205205
"path": "/guides/migrating-to-react-query-3",
206206
"editUrl": "/guides/migrating-to-react-query-3.md"
207+
},
208+
{
209+
"title": "Migrating to React Query 4",
210+
"path": "/guides/migrating-to-react-query-4",
211+
"editUrl": "/guides/migrating-to-react-query-4.md"
207212
}
208213
]
209214
},
@@ -442,4 +447,4 @@
442447
]
443448
}
444449
]
445-
}
450+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
id: migrating-to-react-query-4
3+
title: Migrating to React Query 4
4+
---
5+
6+
## Breaking Changes
7+
8+
### Separate hydration exports have been removed
9+
10+
With version [3.22.0](https://github.com/tannerlinsley/react-query/releases/tag/v3.22.0), hydration utilities moved into the react-query core. With v3, you could still use the old exports from `react-query/hydration`, but these exports have been removed with v4.
11+
12+
```diff
13+
- import { dehydrate, hydrate, useHydrate, Hydrate } from 'react-query/hydration'
14+
+ import { dehydrate, hydrate, useHydrate, Hydrate } from 'react-query'
15+
```
16+
17+
18+
19+

docs/src/pages/reference/hydration.md

-8
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ const dehydratedState = dehydrate(queryClient, {
1515
})
1616
```
1717

18-
> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `dehydrate` from `react-query/hydration`
19-
2018
**Options**
2119

2220
- `client: QueryClient`
@@ -72,8 +70,6 @@ import { hydrate } from 'react-query'
7270
hydrate(queryClient, dehydratedState, options)
7371
```
7472

75-
> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `hydrate` from `react-query/hydration`
76-
7773
**Options**
7874

7975
- `client: QueryClient`
@@ -99,8 +95,6 @@ import { useHydrate } from 'react-query'
9995
useHydrate(dehydratedState, options)
10096
```
10197

102-
> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `useHydrate` from `react-query/hydration`
103-
10498
**Options**
10599

106100
- `dehydratedState: DehydratedState`
@@ -123,8 +117,6 @@ function App() {
123117
}
124118
```
125119

126-
> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `Hydrate` from `react-query/hydration`
127-
128120
**Options**
129121

130122
- `state: DehydratedState`

0 commit comments

Comments
 (0)