From 650f886a61dc5aba1b85cfeda16d4d7255bd01c8 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 10 Jun 2024 10:47:46 +0200 Subject: [PATCH] more explicit `PreloadQuery` return type --- packages/client-react-streaming/src/PreloadQuery.tsx | 2 +- packages/client-react-streaming/src/registerApolloClient.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client-react-streaming/src/PreloadQuery.tsx b/packages/client-react-streaming/src/PreloadQuery.tsx index c5db2270..628d037a 100644 --- a/packages/client-react-streaming/src/PreloadQuery.tsx +++ b/packages/client-react-streaming/src/PreloadQuery.tsx @@ -35,7 +35,7 @@ export function PreloadQuery({ | (( queryRef: TransportedQueryRef, NoInfer> ) => ReactNode); -}) { +}): React.ReactElement { const preloadOptions = { ...options, fetchPolicy: "cache-first" as const, diff --git a/packages/client-react-streaming/src/registerApolloClient.tsx b/packages/client-react-streaming/src/registerApolloClient.tsx index 1d2f9051..be03c4bb 100644 --- a/packages/client-react-streaming/src/registerApolloClient.tsx +++ b/packages/client-react-streaming/src/registerApolloClient.tsx @@ -156,7 +156,7 @@ interface PreloadQueryProps interface PreloadQueryComponent { ( props: PreloadQueryProps - ): React.ReactNode; + ): React.ReactElement; } function makePreloadQuery( @@ -164,7 +164,7 @@ function makePreloadQuery( ) { return function PreloadQuery( props: PreloadQueryProps - ): React.ReactNode { + ): React.ReactElement { // we directly execute the bound component instead of returning JSX to keep the tree a bit tidier return UnboundPreloadQuery({ ...props, getClient }); };