-
Notifications
You must be signed in to change notification settings - Fork 640
fix(Banner): rewrite PrimaryAction & SecondaryAction types #5055
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(Banner): rewrite PrimaryAction & SecondaryAction types #5055
Conversation
🦋 Changeset detectedLatest commit: ced3929 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 |
size-limit report 📦
|
| </Button> | ||
| ) | ||
| } | ||
| }) as PolymorphicForwardRefComponent<'button', BannerPrimaryActionProps> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we necessarily care about forwarding a ref here but it's the only way I found to get the type-checking to pass (mimicked Button). Open to suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to me, I'd do the same but yeah open to be convinced otherwise 😅
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/344960 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
| </Button> | ||
| ) | ||
| } | ||
| }) as PolymorphicForwardRefComponent<'button', BannerPrimaryActionProps> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to me, I'd do the same but yeah open to be convinced otherwise 😅
…nd-bannersecondaryaction-button-to-support-href
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
Closes https://github.com/github/primer/issues/3967
Modifies the
Banner.PrimaryActionandBanner.SecondaryActioncomponent types to solve for current type error when attempting to useasprop.Changelog
Changed
Updates
Banner.PrimaryAction&Banner.SecondaryActionto export as aPolymorphicForwardRefComponentto allow for better type inference and usage of theasprop.Rollout strategy
Testing & Reviewing
If desired, you may render a
Bannerin your local environment to test with:Merge checklist