-
Notifications
You must be signed in to change notification settings - Fork 615
Button should respect polymorphic as prop #2166
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
Changes from all commits
dfde57d
947438c
a1334b0
d545bd4
355c5c4
3cd8648
e1097c9
00292a4
074bc03
469d76a
6a79a13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/react': patch | ||
--- | ||
|
||
button should be polymorphic |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,10 @@ export type VariantType = 'default' | 'primary' | 'invisible' | 'danger' | 'outl | |
|
||
export type Size = 'small' | 'medium' | 'large' | ||
|
||
type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton> | ||
/** | ||
* Remove styled-components polymorphic as prop, which conflicts with radix's | ||
*/ | ||
type StyledButtonProps = Omit<ComponentPropsWithRef<typeof StyledButton>, 'as'> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the crux of the fix here seems like the |
||
|
||
type ButtonA11yProps = {'aria-label': string; 'aria-labelby'?: never} | {'aria-label'?: never; 'aria-labelby': string} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow
as
to be overwritten by passed in props