Skip to content

Fix TypeScript trpc types #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions templates/react/file-router/src/routes/__root.tsx.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import appCss from '../styles.css?url'
<% } %><% if (addOnEnabled["tanstack-query"]) { %>
import type { QueryClient } from '@tanstack/react-query'
<% if (addOnEnabled.tRPC) { %>
import { TRPCRouter } from '@/integrations/trpc/router'
import type { TRPCRouter } from '@/integrations/trpc/router'
import type { TRPCOptionsProxy } from '@trpc/tanstack-react-query'
<% } %>

interface MyRouterContext {
queryClient: QueryClient
<% if (addOnEnabled.tRPC) { %>
trpc: TRPCRouter
trpc: TRPCOptionsProxy<TRPCRouter>
<% } %>
}<% } %>

Expand Down Expand Up @@ -78,4 +79,4 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</html>
)
}
<% } %>
<% } %>