linaria
linaria copied to clipboard
`forwardedAs` prop similar to styled-components
Describe the feature
Is it possible to provide forwardedAs prop similar to that of styled-components along with the usual as prop?
Motivation
When nesting and overriding styled components we sometimes end up overriding the custom component with the as prop.
const Text = styled.p``
const Title = styled(Text)``
<Title as="h1">Title</Title>
Possible implementations
This could be solved with the help of a forwardedAs prop
<Title forwardedAs="h1">Title</Title>
Related Issues
N.A.
Here's a repro: https://codesandbox.io/s/gifted-hamilton-loczx?file=/src/App.js
This feature is really needed