-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Toggle] Remove style-propable mixin #3189
Conversation
@newoga That looks good 👍. |
@oliviertassinari I'm done with this, should we merge, get another pair of eyes to take a look? |
👍 It's all good. |
|
||
let iconStyle = this.mergeStyles( | ||
const iconStyle = Object.assign({}, |
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.
Don't worry too much about the let/const
. One month ago, I have tried to implement a fix function for the eslint rule. It was almost working. We can almost automate this.
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.
Awesome! That's good to know, I definitely support whenever we can reliably automate something 👍
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.
Actually, the pain points are those ones:
let {
anchorOrigin,
className,
iconButtonElement,
iconStyle,
onItemTouchTap,
onKeyboardFocus,
onMouseDown,
onMouseLeave,
onMouseEnter,
onMouseUp,
onTouchTap,
menuStyle,
style,
targetOrigin,
...other,
} = this.props;
When one of the previous variables is used as a let
, I can't use const
at the top.
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.
Yeah I think I noticed this too when I was doing it. If I remember correctly it was iconButtonElement
that could possibly be reassigned. If we pass the elements that get passed in as props to a stateless internal component, that could handle the logic and we could probably make all of these const
then.
Though that process would be tough to automate.
[Toggle] Remove style-propable mixin
@newoga Thanks! You are a beast 🐻. |
Thanks! 😄 |
No description provided.