hydrate
adds a previously dehydrated state into a cache
. If the queries included in dehydration already exist in the queryCache, hydrate
does not overwrite them.
import { hydrate } from 'react-query/hydration'hydrate(queryClient, dehydratedState, options)
Options
client: QueryClient
queryClient
to hydrate the state intodehydratedState: DehydratedState
options: HydrateOptions
defaultOptions: DefaultOptions
mutations: MutationOptions
The default mutation options to use for the hydrated mutations.queries: QueryOptions
The default query options to use for the hydrated queries.The latest TanStack news, articles, and resources, sent to your inbox.