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

HydrationBoundary.svelte

22 lines484 Bytes

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