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

209
Views
React js Material ui Cannot read properties of undefined (reading 'up')

I updated to the latest version, I'm getting the following error message: TypeError: Cannot read properties of undefined (reading 'breakpoints')

package.json:

    "@emotion/react": "^11.8.1",
    "@emotion/styled": "^11.8.1",
    "@mui/icons-material": "^5.4.4",
    "@mui/material": "^5.4.4",
    "@mui/styles": "^5.4.4",
    "react": "^17.0.2",
    "react-dom": "^16.13.1",

Code:

import {
    createTheme,
    useTheme,
    ThemeProvider,
} from "@mui/material";
import { makeStyles } from '@mui/styles';

....

const useStyles = makeStyles((theme) => ({
        root: {
            display: "flex"
        },
        drawer: {
            [theme.breakpoints.up("lg")]: {
                width: drawerWidth,
                flexShrink: 0
            }
        },
        appBar: {
            [theme.breakpoints.up("lg")]: {
                width: `calc(100% - ${drawerWidth}px)`,
                marginLeft: drawerWidth
            }
        },
        menuButton: {
            marginRight: theme.spacing(2),
            [theme.breakpoints.up("lg")]: {
                display: "none"
            },
            backgroundColor: darkState ? grey[900] : blue[500]
        },
        // necessary for content to be below app bar
        toolbar: theme.mixins.toolbar,
        drawerPaper: {
            width: drawerWidth,
            color: "#ffffff",
            backgroundColor: darkState ? grey[900] : blue[500]
        },
        content: {
            flexGrow: 1,
            padding: theme.spacing(3)
        }
    }));

    const classes = useStyles();
    const theme = useTheme();

   ...

    return (
        <ThemeProvider theme={darkTheme}>
            <div className={classes.root}>
             ....
            </div>
        </ThemeProvider>
    );

Example: Codesandox

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

put ThemeProvider to the upper component

about 4 years ago · Juan Pablo Isaza Report
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!