question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Material UI classes argument and composition.

See original GitHub issue

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).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ProtonGustavecommented, Sep 2, 2021

@garronej looks like it works, thank you!

1reaction
ProtonGustavecommented, Aug 31, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found