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