Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Unable to create custom Alert styles in MUI v5 - Cannot read properties of undefined (reading 'type')

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
          }
        }
      }
    ]
  }
};

Component

  <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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!