Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import makeStyles from Material UI?

I am using Material UI version 5.2.7. When I import makeStyles from @mui/materials/styles, I am getting the following error -

Uncaught Error: MUI: makeStyles is no longer exported from @mui/material/styles. You have to import it from @mui/styles. See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.

It also says that @mui/styles is deprecated in Material UI version 5. So I am confused about how I can import makeStyles. Does anyone have any idea about this?

like image 747
Rasheduzzaman Sourov Avatar asked Dec 05 '25 18:12

Rasheduzzaman Sourov


1 Answers

As you can see in documentation, using makeStyles is deprecated now in Material UI as a concept, because they do not want to use JSS anymore, instead they suggest using emotion/react library or styled components.

like image 72
Wraithy Avatar answered Dec 08 '25 09:12

Wraithy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!