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(IconButton): loosen polymorphic type to allow for any type of JSXElement #1494

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

scurker
Copy link
Member

@scurker scurker commented May 29, 2024

closes #1490

The original intention was to only allow for button or a elements to be passed in here. Unfortunately, this can be somewhat restrictive since the intrinsic element type is not known leading to errors when trying to pass something in like a link from React Router. We lose a little bit of safety here, but we do try to do some duck typing in the component to figure out if the role should be a button or link so we're not losing too much by loosening the type restrictions.

@scurker scurker requested a review from a team May 29, 2024 19:03
@scurker scurker marked this pull request as ready for review May 29, 2024 19:03
@scurker scurker requested a review from a team as a code owner May 29, 2024 19:03
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1494.d15792l1n26ww3.amplifyapp.com

@scurker scurker merged commit 0408555 into develop Jun 5, 2024
8 checks passed
@scurker scurker deleted the fix-icon-button-type branch June 5, 2024 14:02
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.

Bug: IconButton triggers a compilation error when passed a React-Router-Dom Link component for as attribute
2 participants