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

[FlatButton] Add className property #6148

Merged
merged 3 commits into from
Feb 18, 2017
Merged

[FlatButton] Add className property #6148

merged 3 commits into from
Feb 18, 2017

Conversation

Shahrukh-Zindani
Copy link

@Shahrukh-Zindani Shahrukh-Zindani commented Feb 15, 2017

Adds className to FlatButton property. Close issue #5906.

@muibot muibot added PR: Needs Review PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Needs Review labels Feb 15, 2017
@oliviertassinari oliviertassinari added PR: Review Accepted and removed PR: Needs Review PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Feb 16, 2017
Copy link
Member

@oliviertassinari oliviertassinari left a 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.

@@ -258,6 +263,7 @@ class FlatButton extends Component {
return (
<EnhancedButton
{...other}
className={className}
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(better for perf)

Copy link
Author

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.

Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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.

Copy link
Author

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.

@oliviertassinari oliviertassinari added PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Review Accepted labels Feb 17, 2017
@oliviertassinari oliviertassinari added PR: Review Accepted and removed PR: Needs Review PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Feb 18, 2017
@oliviertassinari oliviertassinari changed the title [FlatButton] Add className property. [FlatButton] Add className property Feb 18, 2017
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Feb 18, 2017
@oliviertassinari oliviertassinari merged commit 701d1b0 into mui:master Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants