T
tRPC

Get object type using UseTRPCQueryResult

Get object type using UseTRPCQueryResult

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

type InviteNotificationProps = {
notification: playlistOutputData;
};
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?
ZZion8/15/2023
solved it

Looking for more? Join the community!

T
tRPC

Get object type using UseTRPCQueryResult

Join Server