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

306
Views
El tema está vacío en makeStyles para @mui/styles en comparación con @material-ui/core

Estoy tratando de actualizar a material-ui de la versión 4.11 a la versión 5 pero tengo problemas con los temas

 import { createTheme } from '@mui/material/styles'; import { ThemeProvider, StyledEngineProvider, } from '@mui/material/styles'; const theme = createTheme({ ...custom themes }); <StyledEngineProvider injectFirst> <ThemeProvider theme={theme}> <App /> </ThemeProvider> </StyledEngineProvider> Inside the app scenario 1 import { makeStyles } from "@mui/styles"; scenario 2 import { makeStyles } from "@material-ui/core"; const useStyles = makeStyles((theme)=>{ console.log("theme ",theme) return ({ ...my themes }) }

la consola muestra un objeto vacío para el escenario 1 en caso de mui/styles mientras que hay un objeto de tema disponible para el escenario 2 con material-ui

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

0

El problema aquí es que está importando su ThemeProvider desde @mui/material/styles . Para que el objeto del tema se complete correctamente en makeStyles, deberá importar el ThemeProvider exportado por el paquete @mui/styles .

Ahora habiendo dicho eso. MUI está desaprobando makeStyles (y el paquete @mui/styles todos juntos). Puede ver aquí en sus documentos de migración v4 a v5 que recomiendan usar tss-react como un reemplazo de makeStyles, asumiendo que está usando emoción como su motor de estilo. https://mui.com/material-ui/guides/migration-v4/#2-use-tss-react

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!