-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[FlatButton] Add className property #6148
Conversation
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.
Documenting the className on the master is a good idea. That's an exception to the "we don't document native properties" as it's an important customization one.
src/FlatButton/FlatButton.js
Outdated
@@ -258,6 +263,7 @@ class FlatButton extends Component { | |||
return ( | |||
<EnhancedButton | |||
{...other} | |||
className={className} |
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, I'm wondering, do we need to explicit the className property here? If you don't destructure it, it will be inside the other
object. That would reduce the number of ligne of code.
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.
(better for perf)
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.
@oliviertassinari I tried removing this line from here and className does not work. Looks like it is not inside the other
object.
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.
If you destructure it, it won't be inside. That's expected.
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 am not able to understand your approach to handle className. className is not defined in EnhancedButton or its parent so according to my understanding we would have to explicitly need a className property here to make it work. Can you confirm my understanding or give an example to show me how you would make it work without explicitly having className property there.
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.
Just keep the className propTypes. That should do the work.
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.
Got it. This is ready to get merged now.
Adds className to FlatButton property. Close issue #5906.