How to know with of the type is being passed in from a union type parameter in Typescript?

前端 未结 0 1951
梦谈多话
梦谈多话 2020-11-30 13:11

e.g.

export const getLabel = (
    type: PostType | UserType | PostStatusType | UserStatusType | ReportStatusType,
    t: TFunction,
) => {
    switch (typ         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题