Open History to see the last commit
1import {
2 type HydrateOptions,
3 type QueryClient,
4 hydrate,
5} from '@tanstack/query-core'
6import { useQueryClient } from './useQueryClient'
7β
8export function useHydrate(state?: unknown, options?: HydrateOptions) {
9 const client: QueryClient = useQueryClient()
10β
11 if (state) {
12 hydrate(client, state, options)
13 }
14}