Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

HydrationBoundary.svelte

27 lines551 Bytes

1<script lang="ts">
2 import { useHydrate } from './useHydrate.js'
3 import type { Snippet } from 'svelte'
4 import type {
5 DehydratedState,
6 HydrateOptions,
7 QueryClient,
8 } from '@tanstack/query-core'
9​
10 type Props = {
11 children: Snippet
12 state: DehydratedState
13 options: HydrateOptions | undefined
14 queryClient: QueryClient | undefined
15 }
16​
17 const {
18 children,
19 state,
20 options = undefined,
21 queryClient = undefined,
22 }: Props = $props()
23​
24 useHydrate(state, options, queryClient)
25</script>
26​
27{@render children()}