-
Notifications
You must be signed in to change notification settings - Fork 127
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
Improve type for icon prop #1615
Conversation
🦋 Changeset detectedLatest commit: 6727601 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## next #1615 +/- ##
==========================================
- Coverage 96.88% 96.87% -0.01%
==========================================
Files 258 258
Lines 23186 23188 +2
Branches 2160 2164 +4
==========================================
+ Hits 22463 22464 +1
Misses 715 715
- Partials 8 9 +1
|
This comment was marked as outdated.
This comment was marked as outdated.
0b184f4
to
ef09973
Compare
ef09973
to
61aa59f
Compare
b1a3e28
to
6727601
Compare
Purpose
While working on the new https://developer.sumup.com, I found a couple of inconsistencies in Circuit UI. I tried to narrow the type of the
icon
prop in all components that accept it by specifying the accepted sizes. However, TypeScript throws a fit whenever thesize
prop doesn't match exactly.Instead, I changed the default size to
any
to work around this TypeScript limitation and added a newIconComponentType
export to the@sumup/icons
package.Approach and changes
IconProps
default size type toany
size
prop on the Button'sicon
prop based on the Button'ssize
propDefinition of done