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(15510): Update Interface to Include href Prop in SwitcherItem Type #16043

Merged
merged 11 commits into from Apr 1, 2024

Conversation

2nikhiltom
Copy link
Contributor

Closes #15510

Added optional 'href' prop to BaseSwitcherItemProps for link URLs.

New
Added href prop to BaseSwitcherItemProps

Testing / Reviewing

<Switcher aria-label="Switcher Container" expanded={true}>
  <SwitcherItem aria-label="Link 1" href="#">
    Link 1
  </SwitcherItem>
</Switcher>

Test the usage of SwitcherItem with the href prop in a TypeScript environment within a Switcher component. Verify that the TypeScript compiler should not throw error and the component renders without errors and correctly applies the provided href attribute

@2nikhiltom 2nikhiltom requested a review from a team as a code owner March 25, 2024 04:06
Copy link

netlify bot commented Mar 25, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 00b2e0f
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/660ab317a10d200008224253
😎 Deploy Preview https://deploy-preview-16043--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.

@2nikhiltom 2nikhiltom changed the title (TS) Updates BaseSwitcherItemProps for href prop fix(15510): Update Interface to Include href Prop in SwitcherItem Type Mar 25, 2024
Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

This also needs:

  • To be added to the PropTypes with the same comment
  • Pulled out of ...rest to instead be a named prop within the component, and placed onto Link

@2nikhiltom 2nikhiltom requested a review from a team as a code owner March 27, 2024 13:15
Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Awesome!

@tay1orjones tay1orjones added this pull request to the merge queue Mar 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 28, 2024
@2nikhiltom 2nikhiltom added this pull request to the merge queue Apr 1, 2024
Merged via the queue into carbon-design-system:main with commit 599fbf0 Apr 1, 2024
20 checks passed
@2nikhiltom 2nikhiltom deleted the TS_error_href_prop branch April 1, 2024 16:55
preetibansalui pushed a commit to tay1orjones/carbon that referenced this pull request Apr 24, 2024
carbon-design-system#16043)

* fix(15510): update switcherItem interface

* Update SwitcherItem.tsx

* fix(15510): update propType and href passed to Link

* chore(15510): fix typo

* chore: update snaps

---------

Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: TS error: href prop does not exist in SwitcherItem type
3 participants