最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Uncaught Error: Material UI: makeStyles is not longer exported from @muimaterialstyles - Stack Overflow

programmeradmin2浏览0评论

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

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

Share Improve this question edited May 30, 2023 at 17:29 NearHuscarl 81.3k22 gold badges318 silver badges280 bronze badges asked Sep 28, 2021 at 17:38 Jagannath SwarnkarJagannath Swarnkar 3691 gold badge3 silver badges11 bronze badges 1
  • Code snippet https://stackoverflow.com/a/69457917/6207266 – Hillsie Commented Oct 5, 2021 at 22:50
Add a comment  | 

3 Answers 3

Reset to default 9

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.

Install This :

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

Import This :

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

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';
发布评论

评论列表(0)

  1. 暂无评论