Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify the order in which the style sheets appear in the document?

Tags:

material-ui

I have several styled components, using the withStyles HOC to export them, but i can't override some rules because jss mix the order of mui stylesheets with my component's stylesheets.

How can I push my styles to the end?

enter image description here

like image 577
atoledo Avatar asked Mar 08 '18 18:03

atoledo


1 Answers

Me and my team also stumbled upon this and we managed to find a solution. Apparently withStyles, takes an option object as parameter. So in order to solve this issue, you need to pass a parameter index with a value of 1. So what you get is this:

withStyles(styles, {index: 1})(yourComponent)
like image 124
user1915308 Avatar answered Oct 07 '22 16:10

user1915308