You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
// Should throw an error in the `href`<Componentas="button"href="www.google.com"/>
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: