callstack / callstack/linaria

`forwardedAs` prop similar to styled-components

Open
#713 2 comments 2 reactions 0 assignees View on GitHub
feature: proposal 💬 needs: triage 🏷
Dominant language
TypeScript
Stars
12.4k
Forks
413
PR merge metrics
No merged PRs in 30d

Description

## Describe the feature

Is it possible to provide `forwardedAs` prop similar to that of [`styled-components`](https://styled-components.com/docs/api#forwardedas-prop) 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
```

## Possible implementations

This could be solved with the help of a `forwardedAs` prop

```
Title
```

## Related Issues

N.A.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.