Zion
Zion17mo ago

Get object type using UseTRPCQueryResult

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?
1 Reply
Zion
ZionOP17mo ago
solved it

Did you find this page helpful?