-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[core] Add a new classes property to all the components #6911
Conversation
That's probably the biggest refactorization I have ever done on Material-UI. After hours of tracking down all the issues, it's green 🚀 ! |
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.
Great work! Thank you for all this effort. Only two trivial flow changes from my perspective. I'm in favor of merging this ASAP.
src/Dialog/Dialog.js
Outdated
|
||
type Props = { | ||
/** | ||
* Dialog children, usually the included sub-components. | ||
*/ | ||
children?: Element<*>, | ||
/** | ||
* Useful to extend the style applied to components. | ||
*/ | ||
classes: any, |
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.
This should probably be classes: Object
, because it won't be a Function or scalar type.
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 have tried object
with no luck. thanks for the tip!
|
||
const dialogProps = { | ||
fullScreen, | ||
function ResponsiveFullScreen(props: { width: string }) { |
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'm curious about this style change. No objection, just curious why.
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.
No real motivation, I was in that mood:
- Using named function over anonymous one everywhere possible (we have very few, if not zero components written with arrow-function), so reducing entropy.
- Removing intermediary variables
src/Grid/Grid.js
Outdated
|
||
type Props = { | ||
/** | ||
* The content of the component. | ||
*/ | ||
children?: Element<*>, | ||
/** | ||
* Useful to extend the style applied to components. | ||
*/ | ||
classes: any, |
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.
classes: Object
Why
Short term goal:
Long term goal:
What
+0.27%
.createStyleSheet
. Should also dissuade destructuring the theme as it's simpler to statically analyse the usage of the theme without.withStyles
. Should allow users to provide aclasses
property. And help us toward implementing a correct theme propagation rerender.innerRef
callback property to access the internal component refinputRef
property for the text field components so we don't have to exposefocus()
,blur()
,select()
, etc. methods.next
branch as well as the injected style and the applied class names.overrides
documentation is now fully documented.