t
tRPC
t
tRPC
Pass a type to React component props
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
S
sachin
•
11/25/22, 10:38 PM
https://trpc.io/docs/infer-types
Inferring Types | tRPC
It is often useful to wrap functionality of your
@trpc
/client or
@trpc
/react
-query api within other functions
. For this purpose
, it
's necessary to be able to infer input types and output types generated by your
@trpc
/server router
.
S
sachin
https://trpc.io/docs/infer-types
H
Hussam
•
3/6/23, 11:13 PM
Is there a way to infer everything
?
coinsider the above example
const { data: budgetBoxes } = trpc.....
const { data: budgetBoxes } = trpc.....
this can be inferred by
RouterOutputs
RouterOutputs
how do we infer the type we get on hovering over budgetBoxes
?
const budgetBoxes = trpc....
const budgetBoxes = trpc....
const { data: budgetBoxes } = trpc.....
const { data: budgetBoxes } = trpc.....
RouterOutputs
RouterOutputs
const budgetBoxes = trpc....
const budgetBoxes = trpc....