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

Material UI classes argument and composition. #15

Closed
ProtonGustave opened this issue Aug 23, 2021 · 9 comments
Closed

Material UI classes argument and composition. #15

ProtonGustave opened this issue Aug 23, 2021 · 9 comments

Comments

@ProtonGustave
Copy link

ProtonGustave commented Aug 23, 2021

Problem: i use composition as you proposed in docs, but there is a problem when i use it with classes props from MUI.
Let's i have styles object tableRow, i need it class name to use in composition, i'm doing css(tableRow) and it returns tss-react-1yphcmd i then use classes.tableRow in component code like this classes={{ root: classes.tableRow }}.
Then in browser i see this element has class tss-react-1yphcmd-MuiTableRow-root, i.e. something added -MuiTableRow-root string. What's the problem? I see easy workaround here but i really would prefer to simply use css(tableRow).

@ProtonGustave
Copy link
Author

I double checked, tss-react-1yphcmd suffix here is not same too.

@ProtonGustave
Copy link
Author

ProtonGustave commented Aug 23, 2021

So it looks like MUI compose styles and therefore there is another class. I see 2 problems with that:

  1. old not used styles exists on page
  2. can't do composition

Any thoughts?

@garronej
Copy link
Owner

Thanks for reporting, I will look into it latter today.

@garronej garronej mentioned this issue Aug 23, 2021
@garronej
Copy link
Owner

garronej commented Aug 29, 2021

I am investigating the issue

@garronej
Copy link
Owner

I think I got it, let me release a new version

@garronej
Copy link
Owner

Sorry it took me so long to address this major issue.
It's fixed in the latest version, if you configure your project as it is specified in the readme section for mui v5.

@ProtonGustave
Copy link
Author

@garronej sorry for long response, thanks for effort, I'll test it soon.

@garronej
Copy link
Owner

Hi @ProtonGustave,
Just a small notice to inform you that I updated the instructions on how to setup tss with mui yet again and I also made some small API changes.
Sorry for the instability of the API. Everything will be freezed once mui v5 release.
See new instructions

@ProtonGustave
Copy link
Author

@garronej looks like it works, thank you!

gitbook-com bot pushed a commit that referenced this issue Jan 23, 2022
gitbook-com bot pushed a commit that referenced this issue Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants