Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Button] Can't specify 'as' property directly on Button component #107

Closed
paulocfjunior opened this issue Apr 29, 2020 · 3 comments · Fixed by #355
Closed

[Button] Can't specify 'as' property directly on Button component #107

paulocfjunior opened this issue Apr 29, 2020 · 3 comments · Fixed by #355
Assignees
Labels

Comments

@paulocfjunior
Copy link
Contributor

We should be able to specify an as property on a component in a way that it's rendered using a different Primitive that it usually should use. For some reason, it's not possible to do this in some places.

@paulocfjunior paulocfjunior added the kind/bug Something isn't working label Apr 30, 2020
@paulocfjunior
Copy link
Contributor Author

After a discussion, we found out that it's a problem specific to a project, probably due to the Typescript version.
I think we could try to update the TS version and try to reproduce (and eventually solve it).

@matthieuh matthieuh reopened this Oct 26, 2021
@seedy seedy self-assigned this Dec 2, 2021
@seedy
Copy link
Contributor

seedy commented Dec 2, 2021

NB: as prop has been deprecated on Radix primitives in favour of asChild and cloneElement design pattern.

I think we should follow that, as they went away from polymorphism because of issues with typing and composition

Here is a discussion where the Radix team recommends mimicking asChild with their Slot lib: radix-ui/primitives#901

@seedy seedy changed the title Can't specify 'as' property directly on Button component [Button] Can't specify 'as' property directly on Button component Jan 18, 2022
@seedy seedy mentioned this issue Apr 13, 2022
6 tasks
@traefiker
Copy link
Contributor

🎉 This issue has been resolved in version 4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants