TypeError: (0 , _material_ui_core__WEBPACK_IMPORTED_MODULE_3__.makeStyles) is not a function

Viewed 412

I am getting this error when compiling in Layout.js My code:

import { makeStyles } from '@material-ui/core';

 const useStyles = makeStyles({
     page: {
         background: '#f9f9f9',
         width:'100%'
     },
     drawer:{
         width: drawerWidth

     }
 });
1 Answers

From the error it is clear that makeStyles is not available in the dependency @material-ui/core. Use the line below instead to fix the issue where makeStyles is imported from @material-ui/core/styles

import { makeStyles } from '@material-ui/core/styles';

Related