fix(Link): destructure muted prop to prevent unintentional DOM attribute leakage#7631
fix(Link): destructure muted prop to prevent unintentional DOM attribute leakage#7631
muted prop to prevent unintentional DOM attribute leakage#7631Conversation
🦋 Changeset detectedLatest commit: 230d875 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
muted prop to prevent unintentional DOM attribute leakage
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the Link component where the muted prop was not destructured from restProps, causing it to leak as a bare HTML attribute on the DOM element. This could trigger React warnings about non-boolean attributes.
Changes:
- Destructure
mutedfrom props alongsideinlineandhoverColorinLink.tsx, and reference the extracted variable fordata-muted - Add a test assertion verifying the bare
mutedattribute is not present on the rendered DOM element
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/react/src/Link/Link.tsx |
Destructures muted from props to prevent DOM attribute leakage; updates data-muted to use the extracted variable |
packages/react/src/Link/__tests__/Link.test.tsx |
Adds assertion to existing "muted" test to verify the bare muted attribute is absent from the DOM |
|
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
mutedis not present as a bare DOM attribute onLinkpatchfor@primer/react)🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.