lukas
lukas2y ago

V10. How to infer types on V10?

https://trpc.io/docs/v9/infer-types I am trying to infer types to use the inputs on my yup forms in the front end but can't get this working and did not find an example docs for that. The current example available at https://trpc.io/docs/v9/infer-types is depreciated on v10. I managed to get this working by doing this as shown by the screenshot. Is this the way to go, can I build some auxiliary types to use this structure to infer inputs/outputs?
Inferring Types | tRPC
It is often useful to wrap functionality of your @trpc/client or @trpc/react api within other functions. For this purpose, it's necessary to be able to infer input types, output types, and api paths generated by your @trpc/server router.
2 Replies
Alex / KATT 🐱
Go to the v10 docs of the same page
lukas
lukas2y ago
Thanks 🙂