I'm trying to migrate my components from MUI v4 to v5, and I've gotten to a point where I don't know how to migrate my makeStyles
components.
Before, I had something like this that was working:
const useStyles = makeStyles((theme: Theme) => ({
paper: {
padding: theme.spacing(2),
someMore: 'styles'
}
}));
// ...
const Component: FC = () => {
const theme = useTheme();
const classes = useStyles(theme);
return (
<Paper elevation={3} className={classes.paper}>
<Stuff />
</Paper>
)
}
Now I'm getting an error on the useStyles
call:
This expression is not callable. Type 'never' has no call signatures.ts(2349)
What is the workaround in this case?
makeStyles
anduseTheme
from@mui/material
. I'm also seeing aStyledEngineProvider
at root. I'm usingThemeProvider
. Is there a difference? Which should I use? – Overwrought