hydration/hydrate
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.
JavaScript
1import { hydrate } from 'react-query/hydration'2 3hydrate(queryClient, dehydratedState, options)Options
client: QueryClient- Required
- The
queryClientto hydrate the state into
dehydratedState: DehydratedState- Required
- The state to hydrate into the client
options: HydrateOptions- Optional
defaultOptions: DefaultOptions- Optional
mutations: MutationOptionsThe default mutation options to use for the hydrated mutations.queries: QueryOptionsThe default query options to use for the hydrated queries.