ZionZ
tRPC3y ago
2 replies
Zion

Get object type using UseTRPCQueryResult

this code
type playlistOutputData = UseTRPCQueryResult<
  inferRouterOutputs<AppRouter>["notifications"]["getUserNotifications"],
  TRPCClientErrorLike<AppRouter>["data"]
>["data"];

type InviteNotificationProps = {
  notification: playlistOutputData;
};
gives me an array of objects, I want to get the type only of the object and not the array of it, to have a component for it, how can I do it?
Was this page helpful?