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

[TreeView] Fix the height of the customization demo #16874

Merged
merged 2 commits into from
Aug 5, 2019

Conversation

mbrookes
Copy link
Member

@mbrookes mbrookes commented Aug 3, 2019

Just to make it match the basic demo.

Also capitalised the labels, although we could probably do with finding labels that match a real-world use-case as our other demos do...

@mbrookes mbrookes added component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation labels Aug 3, 2019
@mui-pr-bot
Copy link

mui-pr-bot commented Aug 3, 2019

No bundle size changes comparing 14e595f...dd41c0c

Generated by 🚫 dangerJS against dd41c0c

@@ -54,40 +70,44 @@ TransitionComponent.propTypes = {
in: PropTypes.bool,
};

const StyledTreeItem = withStyles(theme => ({
Copy link
Member

@oliviertassinari oliviertassinari Aug 4, 2019

Choose a reason for hiding this comment

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

I think that we should use withStyles here. It's the approach we document for customizing components. They might be a case or two where we don't do it, that was because I couldn't get TypeScript to accept it.

But no matter the API, we shouldn't share the same style sheet.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's the approach we document for customizing components

Perhaps we should update the documentation then? The hook method is much cleaner.

we shouldn't share the same style sheet

I did it separately originally, and thought you'd say to combine them! 😆

What's the main concern?

Copy link
Member

@oliviertassinari oliviertassinari Aug 4, 2019

Choose a reason for hiding this comment

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

What's the main concern?

I think that people should be able to copy & paste the customized tree item and to move it into its own file without having to worry about the styles of the overall tree view.


Perhaps we should update the documentation then? The hook method is much cleaner.

I believe that we document makeStyles for page layout styles (but can often be replaced with the Box) and for new components creation. I believe that we also document withStyles for customizing existing components. Migrating to styled-components, we will have to remove all the hook styles.

Copy link
Member Author

Choose a reason for hiding this comment

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

move it into its own file without having to worry about the styles

Okay, that's what I guessed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Migrating to styled-components, we will have to remove all the hook styles.

Sounds like a migration nightmare for users.

Copy link
Member

Choose a reason for hiding this comment

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

I think that the API should still work, my comment was targeted at what we use in the demos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants