Skip to content

fix(polymorphic): Improve prop passthrough for ActionList.LinkItem and Breadcrumbs.Item#7658

Merged
hussam-i-am merged 10 commits intomainfrom
hussam-i-am/fix-passthrough-props
Mar 17, 2026
Merged

fix(polymorphic): Improve prop passthrough for ActionList.LinkItem and Breadcrumbs.Item#7658
hussam-i-am merged 10 commits intomainfrom
hussam-i-am/fix-passthrough-props

Conversation

@hussam-i-am
Copy link
Contributor

@hussam-i-am hussam-i-am commented Mar 12, 2026

Changelog

New

Changed

  • Updates typing for Breadcrumbs.Item to allow passthrough props when using as
  • Updates typing for ActionList.LinkItem to allow passthrough props when using as
  • Fixes Breadcrumsb overflow
  • Adds tests for ActionList.LinkItem

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@hussam-i-am hussam-i-am self-assigned this Mar 12, 2026
@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: 5d1ff4e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Mar 12, 2026
@github-actions
Copy link
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@primer
Copy link
Contributor

primer bot commented Mar 12, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions github-actions bot requested a deployment to storybook-preview-7658 March 12, 2026 20:22 Abandoned
@primer
Copy link
Contributor

primer bot commented Mar 12, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions github-actions bot requested a deployment to storybook-preview-7658 March 13, 2026 16:58 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7658 March 13, 2026 17:09 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-7658 March 13, 2026 19:49 Inactive
@hussam-i-am hussam-i-am marked this pull request as ready for review March 13, 2026 20:01
@hussam-i-am hussam-i-am requested a review from a team as a code owner March 13, 2026 20:01
@hussam-i-am hussam-i-am requested a review from jonrohan March 13, 2026 20:01
Copilot AI review requested due to automatic review settings March 13, 2026 20:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, and NavList.Item to modern-polymorphic (PolymorphicProps + fixedForwardRef) for better as prop 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, and Breadcrumbs.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>
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/16126

@primer-integration
Copy link

Integration test results from github/github-ui:

Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

All checks passed!

@hussam-i-am hussam-i-am added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit 259fdff Mar 17, 2026
53 checks passed
@hussam-i-am hussam-i-am deleted the hussam-i-am/fix-passthrough-props branch March 17, 2026 16:22
@primer primer bot mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants