hydration/hydrate

hydrate adds a previously dehydrated state into a cache. If the queries included in dehydration already exist in the cache, hydrate does not overwrite them.

import { hydrate } from 'react-query/hydration'
hydrate(cache, dehydratedState)

Options

  • cache: QueryCache
    • Required
    • The cache to hydrate the state into
  • dehydratedState: DehydratedState
    • Required
    • The state to hydrate into the cache
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.