Jagannath Swarnkar
Jagannath Swarnkar

Reputation: 369

Uncaught Error: Material UI: makeStyles is not longer exported from @mui/material/styles

makeStyles is not longer exported from @mui/material/styles.

Even I am importing from @mui/styles all over in my project but still it is showing this error.
I removed node_modules and reinstalled but not working

enter image description here

Upvotes: 10

Views: 22517

Answers (3)

Kandianne
Kandianne

Reputation: 21

I had this same issue (with withStyles instead) after I thought I replaced all the imports correctly. Turns out there were still things imported like...

import { withStyles, TableCell, TableBody } from '@mui/material';

So just make sure to search for "withStyles," and/or "withStyles }" in your code editor and ensure you have updated all the imports for withStyles correctly like...

import { withStyles } from '@mui/styles';

Upvotes: 2

Dejvi Epa
Dejvi Epa

Reputation: 63

Install This :

npm install @mui/styles --legacy-peer-deps

Import This :

import { makeStyles } from '@mui/styles';

Upvotes: 4

user17024440
user17024440

Reputation:

makeStyles is not longer exported from @mui/material/styles. It is now export from @mui/styles.

Here:

Install: npm install @mui/styles

Then Import: import { makeStyles } from '@mui/styles';

I hope it mix your problem but if not please tell me in the comment.

Upvotes: 9

Related Questions