From f46e32476b440083430dcc3376bc4ce475aab4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Horv=C3=A1th?= Date: Sat, 2 Dec 2023 02:29:09 +0100 Subject: [PATCH] pass children to StreamedHydration --- .../vike-react-query/renderer/StreamedHydration.tsx | 5 +++-- .../renderer/VikeReactQueryWrapper.tsx | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/vike-react-query/renderer/StreamedHydration.tsx b/packages/vike-react-query/renderer/StreamedHydration.tsx index b828ad57..49f70531 100644 --- a/packages/vike-react-query/renderer/StreamedHydration.tsx +++ b/packages/vike-react-query/renderer/StreamedHydration.tsx @@ -3,6 +3,7 @@ export { StreamedHydration } import type { QueryClient } from '@tanstack/react-query' import { dehydrate, hydrate, DehydratedState } from '@tanstack/react-query' import { uneval } from 'devalue' +import type { ReactNode } from 'react' import { useStream } from 'react-streaming' declare global { @@ -18,7 +19,7 @@ declare global { * - hydrating the query client on the client * - if react-streaming is not used, it doesn't do anything */ -function StreamedHydration({ client }: { client: QueryClient }) { +function StreamedHydration({ client, children }: { client: QueryClient; children: ReactNode }) { const stream = useStream() if (import.meta.env.SSR && stream) { @@ -48,5 +49,5 @@ function StreamedHydration({ client }: { client: QueryClient }) { } window._rqd_ = { push: onEntry } } - return null + return children } diff --git a/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx b/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx index a0910e2e..c0d8151b 100644 --- a/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx +++ b/packages/vike-react-query/renderer/VikeReactQueryWrapper.tsx @@ -20,12 +20,11 @@ export default function VikeReactQueryWrapper({ pageContext, children }: VikeRea const queryClient = __queryClientGlobal ?? new QueryClient(queryClientConfig) return ( - <> - - - {children} - - + + + {children} + + ) }