fix(polymorphic): Improve prop passthrough for ActionList.LinkItem and Breadcrumbs.Item#7658
Conversation
…d Breadcrumbs.Item
…d Breadcrumbs.Item
🦋 Changeset detectedLatest commit: 5d1ff4e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
…m/primer/react into hussam-i-am/fix-passthrough-props
There was a problem hiding this comment.
Pull request overview
Improves Primer React’s polymorphic typing so as-specified components receive correct passthrough props, targeting ActionList.LinkItem and Breadcrumbs.Item (and updating NavList.Item, which wraps ActionList.LinkItem) to address issue #6470.
Changes:
- Migrates
ActionList.LinkItem,Breadcrumbs.Item, andNavList.Itemtomodern-polymorphic(PolymorphicProps+fixedForwardRef) for betterasprop passthrough typing. - Updates Breadcrumbs overflow-menu rendering to forward
as+ extra props into overflow menu items. - Adds unit tests covering polymorphic passthrough for
ActionList.LinkItem,NavList.Item, andBreadcrumbs.Item(including overflow menu case).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/styled-react/src/components/ActionList.tsx | Simplifies styled wrapper typing for ActionList.LinkItem in the legacy styled-components package. |
| packages/react/src/NavList/NavList.tsx | Updates NavList.Item to modern polymorphic typing and forwards as into ActionList.LinkItem. |
| packages/react/src/NavList/NavList.test.tsx | Adds coverage for NavList.Item passthrough props when using as. |
| packages/react/src/Breadcrumbs/Breadcrumbs.tsx | Updates Breadcrumbs.Item typing and forwards as/props into overflow menu rendering. |
| packages/react/src/Breadcrumbs/tests/Breadcrumbs.test.tsx | Adds tests for polymorphic Breadcrumbs.Item and overflow menu passthrough behavior. |
| packages/react/src/ActionList/LinkItem.tsx | Updates ActionList.LinkItem to modern polymorphic typing and preserves slot marker metadata. |
| packages/react/src/ActionList/LinkItem.test.tsx | Adds initial unit tests for ActionList.LinkItem, including as passthrough. |
| .changeset/curly-moments-show.md | Declares a minor release for the typing/passthrough improvement. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/16126 |
Changelog
New
Changed
asasRemoved
Rollout strategy
Testing & Reviewing
Merge checklist