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

feat: button asChild #355

Merged
merged 5 commits into from
Apr 15, 2022
Merged

feat: button asChild #355

merged 5 commits into from
Apr 15, 2022

Conversation

seedy
Copy link
Contributor

@seedy seedy commented Apr 13, 2022

Description

I chose to implement asChild behavior instead of as prop, which is really difficult to handle when we implement components on top of styled.

Also this choice follows the following RFC:

usgae of as prop is not disabled by this PR, simply, we cannot handle polymorphic typing properly. Users can still remove types from the component and make use of as prop if they prefer.

Added test and story to back the use case of a "ButtonLink"

I also reworked state="waiting" implementation, so it doesn't clash with asChild behavior.

Preview

simplescreenrecorder-2022-04-13_12.24.23.mp4

Good PR checkboxes

  • Change has been tested
  • Added/Updated tests
  • Added/Updated stories
  • PR follows conventions
  • Labels are set
  • Project is linked

Good Review checkboxes

ℹ️ Copy the snippet and paste in the review field to fill it
- [ ] I've tested the changes
- [ ] I've agreed on the unit tests (soon to come)
- [ ] I've checked the stories
- [ ] I've read the code and understood it
- [ ] I don't have any more questions
- [ ] I've described any optional improvements
- [ ] I checked PR follows [conventions](https://github.com/traefik/faency#how-to-contribute)

@traefiker
Copy link
Contributor

🎉 This PR is included 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 this pull request may close these issues.

[Button] Can't specify 'as' property directly on Button component
4 participants