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

feat(component): replaced SideNavItems.js -> SideNavItems.tsx component #15084

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

Nirajsah
Copy link
Contributor

@Nirajsah Nirajsah commented Nov 1, 2023

Closes #13603

Detailed Description

  • In this pull request, I have introduced a new component file, SideNavItems.tsx, along with corresponding TypeScript types to enhance type safety. During the development of this component, I encountered an issue. the issue was related to TypeScript's ability to correctly infer types, particularly with regards to (child.type?.displayName).

To resolve the issue with TypeScript's type inference, I implemented a solution by explicitly defining the child's type as React.ComponentType. I then checked whether the displayName property existed within childType. This approach ensured that TypeScript correctly recognised and inferred the types, effectively resolving the issue.

In previous PRs, I unintentionally omitted running the tests before making the commits. I acknowledge and apologise for this oversight. All test suites were successful.

New

  • Added a new file SideNavItems.tsx along with its corresponding TypeScript types. Issue Resolution

Changed

  • SideNavItems.js to SideNavItems.tsx

Removed

  • None

It's important to note that all other aspects of the SideNavItems.tsx file are functioning as expected, and there are no other issues in the codebase.

Testing / Review
Reviewers can verify the changes in this PR by:

  • Examining the new SideNavItems.tsx file and its associated TypeScript types for correctness and completeness.
  • Confirming that the issue related to the isSideNavExpanded prop has been successfully resolved.

@Nirajsah Nirajsah requested a review from a team as a code owner November 1, 2023 19:05
Copy link

netlify bot commented Nov 1, 2023

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 98b1c67
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/6542a198ef88520008b5bf4c
😎 Deploy Preview https://deploy-preview-15084--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 Nov 1, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 98b1c67
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6542a198aa2e2e0008b92ca1
😎 Deploy Preview https://deploy-preview-15084--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.

Thank you!

@github-actions github-actions bot added this pull request to the merge queue Nov 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 7, 2023
@tw15egan tw15egan added this pull request to the merge queue Nov 7, 2023
Merged via the queue into carbon-design-system:main with commit e73113f Nov 7, 2023
17 checks passed
@Nirajsah Nirajsah deleted the SideNavItems branch November 7, 2023 09:22
alisonjoseph added a commit that referenced this pull request Nov 14, 2023
danoro96 pushed a commit to danoro96/carbon that referenced this pull request Jan 18, 2024
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.

Add TypeScript types to SideNavItems
4 participants