snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
32
packages/svelte-query/tests/HydrationBoundary/Base.svelte
Normal file
32
packages/svelte-query/tests/HydrationBoundary/Base.svelte
Normal file
@@ -0,0 +1,32 @@
|
||||
<script lang="ts">
|
||||
import type { QueryClient } from '@tanstack/query-core'
|
||||
import {
|
||||
HydrationBoundary,
|
||||
createQuery,
|
||||
setQueryClientContext,
|
||||
} from '../../src/index.js'
|
||||
import type { DehydratedState } from '@tanstack/query-core'
|
||||
|
||||
type Props = {
|
||||
queryClient: QueryClient
|
||||
dehydratedState: DehydratedState
|
||||
queryFn: () => Promise<string>
|
||||
}
|
||||
|
||||
let { queryClient, dehydratedState, queryFn }: Props = $props()
|
||||
|
||||
setQueryClientContext(queryClient)
|
||||
|
||||
const query = createQuery(() => ({
|
||||
queryKey: ['string'],
|
||||
queryFn,
|
||||
}))
|
||||
</script>
|
||||
|
||||
<HydrationBoundary
|
||||
state={dehydratedState}
|
||||
options={undefined}
|
||||
queryClient={undefined}
|
||||
>
|
||||
<div>data: {query.data ?? 'undefined'}</div>
|
||||
</HydrationBoundary>
|
||||
Reference in New Issue
Block a user