The previous code, which used v4, was
const useStyles = makeStyles(theme => ({
toolbarMargin: {
...theme.mixins.toolbar
}
}))
How to migrate this code to MUI v5 using sx prop, I tried using it like this
<Box
sx={{
...(theme) => theme.mixins.toolbar,
}}
/>
but the theme was not defined.