I am using Material Ui version 5.2.7. When I import makeStyles from @mui/materials/styles, I am getting following error -
Uncaught Error: MUI: makeStyles is not 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.
At also says that @mui/styles is deprecated in mui version 5. So I am confused how I can import makeStyles. Anyone have any idea on this?
CodePudding user response:
As you can see in documentation, using makeStyles is deprecated now in MUI as a concept, because they dont want to use JSS anymore, instead they suggest to use emotion/react library or styled components
CodePudding user response:
you need to install @mui/styles package npm install @mui/styles
and then import makeStyles like this import { makeStyles } from '@mui/styles';
