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: added rel prop in switcher item #17059

Merged

Conversation

riddhybansal
Copy link
Contributor

Closes #17052

Added optional 'rel' prop to BaseSwitcherItemProps.

New
Added rel prop to BaseSwitcherItemProps

Testing / Reviewing

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

Test the usage of SwitcherItem with the rel 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 rel attribute

@riddhybansal riddhybansal requested review from a team as code owners July 29, 2024 12:50
Copy link

netlify bot commented Jul 29, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9de018d
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66a7902d66205f00086d6a88
😎 Deploy Preview https://deploy-preview-17059--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.

Copy link

netlify bot commented Jul 29, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 9de018d
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66a7902d9c016d000782fadc
😎 Deploy Preview https://deploy-preview-17059--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
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.

Looks good! Just one question

/**
* The rel property for the link.
*/
rel?: string;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a specific type off of HTMLAttributes or DOMAttributes or something that we could use here? It's not any string - it's one of a specific set of allowed/expected strings, right?

MDN's list is "some of the most important existing keywords" 🤔 very possible this doesn't exist but figured I'd ask

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we cannot add any string there are some specific keywords that can be used . What do you think should I create an interface and made rel at that type ??

@kennylam kennylam added this pull request to the merge queue Aug 9, 2024
Merged via the queue into carbon-design-system:main with commit e3a8267 Aug 9, 2024
22 checks passed
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: rel prop does not exist in SwitcherItem type
4 participants