Nash
KPCKevin Powell - Community
•Created by Nash on 11/2/2023 in #front-end
Typescript type for array passed as string
I realized I can force(cast) the string to be a string literal Iconos[<HomeTypes>home]
4 replies
KPCKevin Powell - Community
•Created by Nash on 11/2/2023 in #front-end
Typescript type for array passed as string
Yup but the thing is that
homes
is hardcoded, is coming from a JSON response, I've modified the code to only allow 2 Icons but in reality there is actually 4 variations of Icons. e.g. could be house, apartment
or apartment, apartment
or apartment house
4 replies