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(
9 state?: unknown,
10 options?: HydrateOptions,
11 queryClient?: QueryClient,
12) {
13 const client = useQueryClient(queryClient)
14β
15 if (state) {
16 hydrate(client, state, options)
17 }
18}