-
-
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] update components to es6 classes #3843
Conversation
1d0be0e
to
c0403a4
Compare
@callemall/material-ui One issue is that we currently depend on Should we do that for now? Or consider #3163 a hard dependency/blocker for this? (btw, there is an eslint react plugin rule for enforcing |
@nathanmarks My vote is use a babel transform if possible so that we can merge this (however we should still continue to discuss #3163). |
@newoga Want to check it out? I added that transform |
@nathanmarks I'm definitely not convinced by the https://github.com/nathanmarks/babel-plugin-transform-react-es6-displayname/blob/master/index.js babel-plugin. Few components need a |
@oliviertassinari I will remove the plugin and manually add |
@nathanmarks Awesome 👍. |
b45e0e0
to
c0403a4
Compare
70d8aec
to
635767c
Compare
|
||
componentWillMount() { | ||
this.setState({ | ||
date: this._isControlled() ? this._getControlledDate() : this.props.defaultDate, |
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.
isControlled()
instead of _isControlled()
, getControlledDate()
too
}; | ||
}, | ||
state = { | ||
inner: isInner(this.props), |
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.
Same 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.
leaving for now as per our convo
@callemall/material-ui need some more eyes giving this a review 👍 |
Tested every component in the docs site, and looks good here, (bar known-issues that are not related to this PR). |
@mbrookes whoo! awesome, thanks for reviewing 👍 |
Awesome stuff @nathanmarks! |
@nathanmarks Awesome 💯. |
Thanks guys! Glad we got this in and can push on now 👍 |
es6 class codemod update
With some inspiration from @oliviertassinari I was able to hack together a quick fork of
react-codemod
with a class converter that would enable some more es7 features (supported via babel, from the same proposal as thestatic
properties).Please check out the diff and point out anything that is screwed up! :+1
Also, I could not convert
Snackbar
because of the mixin it is using (resizable style something or other...). Hopefully that with an improved solution for styling the mixin will become obsolete anyways.