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 types of SideNavMenuItem #17609

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

frankharkins
Copy link
Contributor

@frankharkins frankharkins commented Sep 30, 2024

Closes #17608

Since SideNavMenuItem forwards its props to Link, I think the type should be ComponentProps<typeof Link>, plus the extra prop that SideNavMenuItem (isActive). While technically unnecessary for the type system, I've left the extra props in the declaration to keep their descriptions in the docs.

Changelog

Changed

  • Type of SideNavMenuItemProps correctly describes the props SideNavMenuItem supports. This change includes adding the "as" prop, which was supported by SideNavMenuItem but showed a type error when used.

Testing / Reviewing

I'm not sure how best to test. There's a repro in #17608. If I should do something else to make reviewing easier, please let me know.

Copy link

netlify bot commented Sep 30, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 8e7c1f4
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/670001e09ad8ca0008492663
😎 Deploy Preview https://deploy-preview-17609--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 30, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 8e7c1f4
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/670001e0b063140008f09638
😎 Deploy Preview https://deploy-preview-17609--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@frankharkins frankharkins marked this pull request as ready for review September 30, 2024 15:11
@frankharkins frankharkins requested a review from a team as a code owner September 30, 2024 15:11
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.07%. Comparing base (14ade63) to head (8e7c1f4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17609   +/-   ##
=======================================
  Coverage   77.07%   77.07%           
=======================================
  Files         409      409           
  Lines       14021    14021           
  Branches     4307     4355   +48     
=======================================
  Hits        10807    10807           
  Misses       3044     3044           
  Partials      170      170           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect types in SideNavMenuItem
2 participants