Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attempted import error: 'makeStyles' is not exported from '@material-ui/core/styles'

I 'm working on a react typescript app and i try to import makeStyles from '@material-ui/core/styles' and it gets me error Attempted import error: 'makeStyles' is not exported from '@material-ui/core/styles'. i installed these :

npm install @material-ui/core @material-ui/icons @types/material-ui
like image 723
Mohamed Ibrahim Avatar asked Jun 28 '21 19:06

Mohamed Ibrahim


2 Answers

This is how i solved it

npm install @mui/styles
import { makeStyles } from '@mui/styles';
like image 187
FightSpeed3 Avatar answered Nov 02 '22 20:11

FightSpeed3


I recently encountered this problem. This problem occurs when using the latest versions of Material UI. To solve you have to import makeStyles otherwise:

Old version : import { makeStyles } from '@material-ui/core'

New version : import { makeStyles } from '@material-ui/styles';

For more informations : https://next.material-ui.com/guides/migration-v4/

like image 24
NSA Avatar answered Nov 02 '22 19:11

NSA