译零 TransZero · TanStack Query v3 中文文档
主站

hydration/Hydrate

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

JavaScript
1import { Hydrate } from 'react-query/hydration'2 3function App() {4  return <Hydrate state={dehydratedState}>...</Hydrate>5}

Options

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