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

126
Views
Material UI v5.4 doesn't like sx or css prop within a ThemeProvider tag

When I try to use an sx prop inside a ThemeProvider tag I am getting the following error:

breakpoints.map is not a function

here is the code:

import { responsiveFontSizes, createTheme } from 
'@mui/material/styles';
import { Box, ThemeProvider } from '@mui/material';
import styled from '@emotion/styled';


let theme = createTheme({
    palette: {
        type: 'dark',
        primary: {
            main: '#3dde7f',
        },
        secondary: {
            main: '#c83737',
        },
        background: {
            default: '#121212',
            paper: '#1a1a1a',
        },
    },
});

theme = responsiveFontSizes(theme);

export default function Main(props) {    
const {accountsStore} = useStores();
return (
    <ThemeProvider theme={theme}>
        <Box sx={{ gridArea: "menu", paddingTop: "40px", marginTop: 
"50px",   maxWidth: "300px" }}>
          <SideNav accountsStore={accountsStore}/>
        </Box>         
    </ThemeProvider>
);
  }

I am able to get it to work with styled components. Any help would greatly appreciated.

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!