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

Add as and asChild property to Button #5996

Closed
mertsincan opened this issue Jul 1, 2024 · 2 comments
Closed

Add as and asChild property to Button #5996

mertsincan opened this issue Jul 1, 2024 · 2 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@mertsincan
Copy link
Member

Prop Default Description
as BUTTON Use to change the HTML tag of root element.
asChild false When enabled, it changes the default rendered element for the one passed as a child element.
@mertsincan mertsincan added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Jul 1, 2024
@mertsincan mertsincan added this to the 4.0.0 milestone Jul 1, 2024
@mertsincan mertsincan self-assigned this Jul 1, 2024
@aeruggiero
Copy link

Hi nice feature!
I would like to suggest that it would be beneficial for the as property to accept Objects.
I am using InertiaJS, and for routing, I have to use the Link component (which translates into an anchor link but with the SPA feature otherwise disabled).

If I use it works, but the console gives this error:
Invalid prop: type check failed for prop "as". Expected String with value "[object Object]", got Object

Thanks!

@mertsincan
Copy link
Member Author

Thanks a lot for your feedback! Could you please create a new github ticket with sample usage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants