Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/remove-link-data-hover-color.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Link: Remove unnecessary `data-hover-color` attribute from rendered DOM element
4 changes: 2 additions & 2 deletions packages/react/src/Link/Link.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,7 +19,8 @@ export const UnwrappedLink = <As extends React.ElementType = 'a'>(
props: PolymorphicProps<As, 'a', StyledLinkProps>,
ref: ForwardedRef<unknown>,
) => {
const {as: Component = 'a', className, inline, muted, hoverColor, ...restProps} = props
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const {as: Component = 'a', className, inline, muted, hoverColor: _hoverColor, ...restProps} = props

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question for you, I just merged https://github.com/github/github-ui/pull/27116 yesterday.

If hoverColor did not do anything, is it still a breaking change to remove the prop?

const innerRef = React.useRef<ElementRef<As>>(null)
const mergedRef = useMergedRefs(ref, innerRef)

Expand All@@ -44,7 +45,6 @@ export const UnwrappedLink = <As extends React.ElementType = 'a'>(
data-component="Link"
data-muted={muted}
data-inline={inline}
data-hover-color={hoverColor}
{...restProps}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ref={mergedRef as any}
Expand Down
Loading