Building Strongly Typed Polymorphic Components #18275
Labels
afrohacks
See https://ibm.biz/afrohacks-hackathon
area: typescript
needs: community contribution
Due to roadmap and resource availability, we are looking for outside contributions on this issue.
planning: umbrella
Umbrella issues, surfaced in Projects views
role: dev 🤖
When using PolymorphicProps in Carbon, we are not accounting for type errors. For example, in the code snippet below, a type error should occur if a user attempts to use an attribute that is incompatible with the specified tag. However, this is not currently being enforced.
There is this really good article that talks about How to Build Strongly Typed Polymorphic Components
Here is a PR that serves as an example of how to implement this.
Components with PolymorphicProps
Text
component #18279Components that could use PolymorphicProps
The text was updated successfully, but these errors were encountered: