hydration/Hydrate

hydration/Hydrate adds a previously dehydrated state into the queryClient that would returned by running useQueryCache. If the client already contains data, the new queries will be intelligently merged based on update timestamp.

import { Hydrate } from 'react-query/hydration'
function App() {
return <Hydrate state={dehydratedState}>...</Hydrate>
}

Options

  • state: DehydratedState
    • The state to hydrate
  • options: HydrateOptions
    • Optional
    • defaultOptions: QueryOptions
      • The default query options to use for the hydrated queries.
Was this page helpful?

Subscribe to our newsletter

The latest TanStack news, articles, and resources, sent to your inbox.

    I won't send you spam.

    Unsubscribe at any time.

    © 2020 Tanner Linsley. All rights reserved.