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

244
Views
Difundir tema en sx prop MUI 5

El código anterior, que usaba v4, era

 const useStyles = makeStyles(theme => ({ toolbarMargin: { ...theme.mixins.toolbar } }))

Cómo migrar este código a MUI v5 usando sx prop, intenté usarlo así

 <Box sx={{ ...(theme) => theme.mixins.toolbar, }} />

pero el theme no estaba definido.

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

0

Puedes hacer lo siguiente:

 <Box sx={theme => theme.mixins.toolbar} />

o

 <Box sx={theme => ({ ...theme.mixins.toolbar, // other sx stuff })} />

Como también puede pasar una función con theme como parámetro a la propiedad sx , debe devolver un objeto sx válido.

about 4 years ago · Juan Pablo Isaza Report

0

Usar styled() es probablemente menos complicado.

 const Container = styled('div')(theme => theme.mixins.toolbar)
about 4 years ago · Juan Pablo Isaza Report

0

Para mí, la mayoría de las soluciones anteriores dieron como resultado un error no fatal, ya que sx acepta objetos, no funciones. Esto funcionó:

 <Box sx={{ "&": (theme) => theme["whateverYouWishToSpread"] }} >{someStuff}</Box>
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!