Passing TRPC fetched data to child via props - Type definitions?

Hi, when I fetch data and loop through it in the same view - the Type for the children of the array are automatically inferred thanks to TRPC
No description
2 Replies
BIƬ DΣЦƧ 🍀
However, if I split it up and fetch data in the parent, then pass it down to the child... I find that I have to define the Type
No description
No description
BIƬ DΣЦƧ 🍀
This feels wrong.... what am I missing? Oh my gosh... murpheys law that when I finally decide to reach out for help I find the answer myself
ProjectType = inferRouterOutputs<AppRouter>["project"]["getAll"];
ProjectType = inferRouterOutputs<AppRouter>["project"]["getAll"];

Did you find this page helpful?