-
-
Notifications
You must be signed in to change notification settings - Fork 396
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: allow partial classes
prop in withStyles
#1428
Conversation
The `classes` prop created by the `withStyles` function is meant to be an optional parameter where you can provide some or all of the style classes.
As a side note, I tried following all of the steps in CONTRIBUTING.md, but several of the steps don't seem to work anymore. There's no item in |
makes sense to me |
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
merged, thanks |
Released in v10.6.0 |
The
classes
prop created by thewithStyles
function is meant to be an optional parameter where you can provide some or all of the style classes.Imagine a somewhat contrived snippet like:
You'd expect to be able to use it in any of the following ways:
The last use case was broken in TypeScript because, while
classes
was an optional prop, each key within class was required. So you'd get an error like:This changes makes sure that the
classes
property is still optional, but that each key within it is optional, too. I abstracted a field out so that I could use it in two places. There's probably about a dozen ways to set something like this up, though, so if you'd prefer it formatted in a different way let me know.