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

fix(Button): only spread additional props onto StyledButton #2359

Merged
merged 11 commits into from Oct 26, 2022

Conversation

joshblack
Copy link
Member

Closes #2351

This PR grabs the extra values from props in ButtonBase and spreads them onto StyledButton.

One thing I noticed is that the props for this custom component would not align with ButtonProps and so I created a CustomButtonProps type to help out with this. I'd love feedback on if this would be the best way to support this, I wasn't quite sure what approach to take.

Something else I noticed is that the custom component through as must accept sx so I made sure the type intersects with SxProp.

@joshblack joshblack requested review from a team and siddharthkp September 21, 2022 16:48
@changeset-bot
Copy link

changeset-bot bot commented Sep 21, 2022

🦋 Changeset detected

Latest commit: b982e6a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 78.14 KB (+0.01% 🔺)
dist/browser.umd.js 78.79 KB (+0.01% 🔺)

@joshblack joshblack temporarily deployed to github-pages September 21, 2022 16:55 Inactive
@joshblack joshblack temporarily deployed to github-pages October 7, 2022 16:25 Inactive
@joshblack joshblack temporarily deployed to github-pages October 10, 2022 16:35 Inactive
@joshblack joshblack changed the title feat(Button): support as prop, add CustomButtonProps type fix(Button): only spread additional props onto StyledButton Oct 10, 2022
@joshblack joshblack temporarily deployed to github-pages October 20, 2022 18:31 Inactive
Copy link
Contributor

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No brainer, ship it!

@joshblack joshblack enabled auto-merge (squash) October 26, 2022 16:25
@joshblack joshblack temporarily deployed to github-pages October 26, 2022 16:31 Inactive
@joshblack joshblack merged commit b05fa74 into main Oct 26, 2022
@joshblack joshblack deleted the 2351-update-button-spread branch October 26, 2022 16:32
@primer-css primer-css mentioned this pull request Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button props spilling to DOM element
2 participants