-
Notifications
You must be signed in to change notification settings - Fork 535
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
Update Button
props to ensure they correctly type check
#2445
Conversation
🦋 Changeset detectedLatest commit: cc79c6c 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
props to ensure they correctly type check
Not sure why canary release seems to fail |
I tested the canary build on memex - https://github.com/github/memex/pull/12803 button now properly catches a bunch of type errors that were introduced in that codebase, without any false positives. Feeling pretty confident here |
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.
LGTM
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.
🚀
Describe your changes here.
Discussed separately in slack
types for Button were being broadened signficantly because the generic interface exposed by the polymorphic component could not be adequately described by the base
forwardRef
implementation. Using the PolymorphicForwardRefComponent helper, allows the type fidelity to be maintained.I've added a type test to validate a few simple cases, and updated places where the types were incorrect in the codebase (now easily noted as failures to build)
One thing to consider - this might be a breaking change for consumers, even though the api should have been this way already
fixes #1956
Screenshots
Please provide before/after screenshots for any visual changes
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.