stitches
stitches copied to clipboard
Polymorphism for Composing React Components
I need "as" prop for polymorphism in a styled react component. I've accessed the styles and variants through the className prop, but I don't know if there's a way to get it.
const baseButton = ({ onclick, className, children }) => {
//...
return <button className={className}>{children}</button>;
};
const Button = styled(baseButton, {
//styles...
});