Hydrate
Hydrates the client cache with data fetched on the server.
- Hooks below it render with the hydrated data on the first render, also during server rendering.
- On the client the data is written to the cache before the hooks mount, so fresh data is not refetched.
- Newer cache data is never replaced by an older snapshot.
- It can be nested and rendered conditionally; every
Hydrateserves only its own client.
Import
import { Hydrate } from "@hyper-fetch/react"
Source
Package
Props
<Hydrate {...props} />
Parameters
| Name | Type | Description |
|---|---|---|
| children | | Children to render |
| client | | Client which cache receives the hydrated data |
| data | | Dehydrated items, usually created on the server with
|
| options | | Options applied to every item, as an object or a function of the item |

