Skip to content

Commit efc4b99

Browse files
fix: Export TanStackQueryProvider as default for Query Client addon
1 parent a72ae49 commit efc4b99

File tree

1 file changed

+10
-1
lines changed
  • packages/create/src/frameworks/react/add-ons/tanstack-query/assets/src/integrations/tanstack-query

1 file changed

+10
-1
lines changed

packages/create/src/frameworks/react/add-ons/tanstack-query/assets/src/integrations/tanstack-query/root-provider.tsx.ejs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if (addOnEnabled.tRPC) { %>
2-
import { QueryClient } from "@tanstack/react-query";
2+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
33
import superjson from "superjson";
44
import { createTRPCClient, httpBatchStreamLink } from "@trpc/client";
55
import { createTRPCOptionsProxy } from "@trpc/tanstack-react-query";
@@ -49,4 +49,13 @@ export function getContext() {
4949
queryClient,
5050
};
5151
}
52+
53+
export default function TanStackQueryProvider({ children }: { children: React.ReactNode }) {
54+
const { queryClient } = getContext()
55+
return (
56+
<QueryClientProvider client={queryClient}>
57+
{children}
58+
</QueryClientProvider>
59+
)
60+
}
5261
<% } %>

0 commit comments

Comments
 (0)