DEV Community

loading...

Discussion on: Classy way of using Typescript Generics

Collapse
joebobmiles profile image
Joseph R Miles

Nice! Had a brief moment where I was worried that using the generic would create a parser error, since it's natural to assume it'd look like: <List<number> />. Then I remembered that, unlike C# (or a lot of languages with generics), TypeScript infers the type parameter, which means the usage would look the same as a non-generic component. Very clever!