Skip to content
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

[styles] Update mergeClasses types to more closely match its implementation #23705

Merged
merged 2 commits into from
Nov 25, 2020
Merged

[styles] Update mergeClasses types to more closely match its implementation #23705

merged 2 commits into from
Nov 25, 2020

Conversation

etrepum
Copy link
Contributor

@etrepum etrepum commented Nov 24, 2020

The types for mergeClasses didn't quite match its implementation. In particular, newClasses and Component are optional, and the values in newClasses should also be allowed to be optional.

This showed up in practice when you are using the classes prop directly from a StyledComponentProps<ClassKey> interface which is a undefined | Partial<ClassNameMap<ClassKey>> so if set, all of the props in classes are optional.

@mui-pr-bot
Copy link

mui-pr-bot commented Nov 24, 2020

No bundle size changes

Generated by 🚫 dangerJS against cf90bec

@oliviertassinari oliviertassinari added package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. typescript labels Nov 24, 2020
@oliviertassinari oliviertassinari merged commit 8b416e2 into mui:next Nov 25, 2020
@oliviertassinari
Copy link
Member

@etrepum It's a great first pull request on Material-UI 👌🏻. Thank you for working on it!

@etrepum
Copy link
Contributor Author

etrepum commented Nov 25, 2020

Thanks for the quick review, well beyond expectations! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants