diff --git a/.changeset/quiet-garlics-compare.md b/.changeset/quiet-garlics-compare.md new file mode 100644 index 00000000000..45b10547d46 --- /dev/null +++ b/.changeset/quiet-garlics-compare.md @@ -0,0 +1,5 @@ +--- +"@primer/react": minor +--- + +Do not pass through hoverColor prop into DOM element diff --git a/packages/react/src/Link/Link.tsx b/packages/react/src/Link/Link.tsx index 9c27320a776..8e98db69c24 100644 --- a/packages/react/src/Link/Link.tsx +++ b/packages/react/src/Link/Link.tsx @@ -17,7 +17,7 @@ type StyledLinkProps = { inline?: boolean } & SxProp -const Link = forwardRef(({as: Component = 'a', className, inline, underline, ...props}, forwardedRef) => { +const Link = forwardRef(({as: Component = 'a', className, inline, underline, hoverColor, ...props}, forwardedRef) => { const innerRef = React.useRef(null) useRefObjectAsForwardedRef(forwardedRef, innerRef) @@ -53,6 +53,7 @@ const Link = forwardRef(({as: Component = 'a', className, inline, underline, ... data-muted={props.muted} data-inline={inline} data-underline={underline} + data-hover-color={hoverColor} {...props} // @ts-ignore shh ref={innerRef} @@ -66,6 +67,7 @@ const Link = forwardRef(({as: Component = 'a', className, inline, underline, ... data-muted={props.muted} data-inline={inline} data-underline={underline} + data-hover-color={hoverColor} {...props} // @ts-ignore shh ref={innerRef} diff --git a/packages/react/src/Link/__tests__/__snapshots__/Link.test.tsx.snap b/packages/react/src/Link/__tests__/__snapshots__/Link.test.tsx.snap index 8b8d5ef784c..33636ed0777 100644 --- a/packages/react/src/Link/__tests__/__snapshots__/Link.test.tsx.snap +++ b/packages/react/src/Link/__tests__/__snapshots__/Link.test.tsx.snap @@ -16,7 +16,7 @@ exports[`Link passes href down to link element 1`] = ` exports[`Link respects hoverColor prop 1`] = ` `;