Skip to content
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

fix(Link): Do not pass through hoverColor prop in Link #5319

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

hussam-i-am
Copy link
Collaborator

Fixes error in integration tests:

      If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error').mockImplementation() and test that the warning occurs.
  
      Warning: React does not recognize the `hoverColor` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `hovercolor` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Changelog

New

Changed

  • Converts the hoverColor prop to a data-hover-color attribute in the Link component.

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@hussam-i-am hussam-i-am self-assigned this Nov 20, 2024
@hussam-i-am hussam-i-am requested a review from a team as a code owner November 20, 2024 17:04
Copy link

changeset-bot bot commented Nov 20, 2024

🦋 Changeset detected

Latest commit: a9ae333

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 20, 2024
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 100.55 KB (-0.14% 🔽)
packages/react/dist/browser.umd.js 101.07 KB (+0.07% 🔺)

@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/351950

@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 20, 2024
@@ -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}
Copy link
Member

Choose a reason for hiding this comment

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

does this need a css counterpart or does it just work? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe it's actually being used any longer since it is deperecated, this just ensures that we don't pass in an invalid attribute into the dom

Copy link
Member

Choose a reason for hiding this comment

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

I see, thanks for explaining that!
Do we gain anything by adding the data-hover-holor then? could we just ignore the prop?

@hussam-i-am hussam-i-am added this pull request to the merge queue Nov 20, 2024
Merged via the queue into main with commit 37c4e97 Nov 20, 2024
47 checks passed
@hussam-i-am hussam-i-am deleted the hussam-i-am/fix-link-hover-color branch November 20, 2024 20:05
@primer primer bot mentioned this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: failing Changes in this PR cause breaking changes in gh/gh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants