Answer the question
In order to leave comments, you need to log in
How to pass any type using generics?
Good afternoon
I'm trying to deal with generics
There are 2 types
1.TUserInfo
type TUserInfo = {
id: num,
readonly fname: string,
readonly lname: string
}
TBody
type TBody = {
success: boolean,
user?: any
}
TBody
pass any type (for example, TUserInfo
). And the same type should be y user
insteadany
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question