How can I make the "as" prop required on a styled-component?

Viewed 21

I have a "Text" component that has visual variants. I don't want to provide a default underlying element (like a span, for example). I feel like requiring the as prop would maintain the polymorphism AND improve discoverability of the fact that the underlying element is a purposeful decision.

I can make the as prop to some other prop, but that would break polymorphism.

0 Answers
Related