t
tRPC
t
tRPC
AppRouter in client is really necessary?
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
D
Dani;
•
1/10/23, 2:28 PM
Please make sure to import
type
{ AppRouter
} from
'
.
/router
'
;
D
Dani;
•
1/10/23, 2:28 PM
And yes
, it is necessary
, otherwise your client will not have access to the type definitions generated by the tRPC server
N
Nick
•
1/10/23, 6:25 PM
2 projects in the same monorepo
? That
's totally normal
, you just import the types from the API and typescript can then validate your client code
N
Nick
•
1/10/23, 6:26 PM
2 projects in different repos isn
't really recommended
, it isn
't really what tRPC is designed for