Lenskha
Lenskha2mo ago

How to get the non-array version of a RouterOutput['myRoute']

Hello, I'm trying to remove as many custom types as possible and instead use inferred types in the frontend. It works great to retrieve data from the server, but less when it comes to process that data via .filter() or .map() functions since those need the non-array version of the type. anyone knows how to do it, or a nice alternative? Thanks 😀
Solution:
How about RouterOutput['myRoute'][number]
Jump to solution
2 Replies
Solution
wleistra
wleistra2mo ago
How about RouterOutput['myRoute'][number]
Lenskha
LenskhaOP2mo ago
oh okay it does work! I tried earlier on another project but the problem was that my route happened to return the any type. Thanks 🙂

Did you find this page helpful?