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
|
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 |
mutedtest that the baremutedHTML attribute is not present on the DOM elementThis can cause hydration errors and warnings (where ssr or csr might not serialize it properly)
Original prompt
This pull request was created from Copilot chat.
🔒 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.