Material UI classes argument and composition.
See original GitHub issueProblem: 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)
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Composition - Material UI - MUI
Composition. MUI tries to make composition as easy as possible. Wrapping components. To provide maximum flexibility and performance, MUI needs a way to...
Read more >Advanced (LEGACY) - MUI System
The wrapped component accepts a classes prop, it simply merges the class names ... You have to forward the parent props to the...
Read more >@mui/styles (LEGACY) - MUI System
MUI aims to provide a strong foundation for building dynamic UIs. For the sake of simplicity, we expose the styling solution used in...
Read more >Styles API - MUI System
Arguments · styles (Function | Object): A function generating the styles or a styles object. It will be linked to the component. Use...
Read more >material-ui/styles
Material -UI aims to provide a strong foundation for building dynamic UIs. For the sake of simplicity, we expose the styling solution used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@garronej looks like it works, thank you!
@garronej sorry for long response, thanks for effort, I’ll test it soon.