I am trying to create custom variants of the Alert component from MUI, but am unable to do this: https://codesandbox.io/s/crimson-glade-tfix6s
When trying to update the theme with:
export const MuiAlert = {
MuiAlert: {
variants: [
{
props: { severity: "text" },
style: {
...root,
background: palette.primary.main,
color: palette.background.default,
"& .MuiSvgIcon-root": {
height: 16
}
}
}
]
}
};
<Alert severity="text">This is an error alert — check it out!</Alert>
I get the error
Cannot read properties of undefined (reading 'type')
Normally I would expect to be able to create somewhat unstyled versions with the variants array found in MuiAlert.