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: badge asChild #354

Merged
merged 3 commits into from
Apr 15, 2022
Merged

feat: badge asChild #354

merged 3 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 "BadgeLink"

Preview

image

Breaking changes

I consider this change non-breaking, because as the issue states, there was an unexpected breaking change brought by b2851f5, which removed as prop and stitches' polymorphic typings. Do you think we should consider this PR bringing a breaking change?

How to test?

  • Check story and test
  • Review code
  • Share your opinion on whether this PR should be considered breaking change or not

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)

@paulocfjunior
Copy link
Contributor

I consider this change non-breaking, because as the issue states, there was an unexpected breaking change brought by b2851f5, which removed as prop and stitches' polymorphic typings. Do you think we should consider this PR bringing a breaking change?

I think it's not a breaking change. We can see from the stories that all other cases were kept untouched.

@traefiker
Copy link
Contributor

🎉 This PR is included in version 4.1.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.

[Badge] "as" prop does not exist on type for Badge
4 participants