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

535
Views
Cómo pasar valores dinámicos a createTheme() de Material UI

Estoy buscando pasar datos al tema predeterminado de Material UI, pero estoy luchando para que funcione.

Aquí está la definición del tema en index.js:

 let theme = createTheme({ primary: { main: '#212121' } })

Y esto es lo que quiero pasar:

 primary: { main: data.website.live.theme.colors.primary }

Esto es lo que probé:

 let theme = createTheme(data, { primary: { main: data.website.live.theme.colors.primary } })

Pero este enfoque no funcionó ya que createTheme solo permite los siguientes argumentos:

  • Opciones (objeto): toma un objeto de tema incompleto y agrega las partes que faltan.
  • ... argumentos (objeto []): fusión profunda de los argumentos con el tema a punto de ser devuelto.

Documentación oficial: https://mui.com/material-ui/customization/theming/#theme-provider

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!