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

270
Views
Reaccionar MUI: cambio de color del grupo de botones en el botón seleccionado

tengo un grupo de botones de Material UI, y el código está aquí

 const [currentProjectSelect, setCurrentProjectSelect] = useState(null);

Este es mi estado.

 <ButtonGroup size="small" className={classes.projectTypeButton}> {projectType === 'offPlatform' && projectTypeValues.map((element, index) => <Button key={element.value} variant="contained" color="primary" className={[classes.budgetButton, {backgroundColor: currentProjectSelect === index ? '#315FFF' : '#fff'}]} onClick={() => { if (currentProjectSelect === null){ form.budget_type = element.value setCurrentProjectSelect(element.name) } else { setCurrentProjectSelect(null) } } } >{element.name}</Button> )} </ButtonGroup>

Aquí, en className, estoy tratando de implementar una lógica en la que el botón seleccionado tendrá un color de fondo diferente. No está trabajando. Solía ser un desarrollador nativo de reacción y la misma lógica utilizada para trabajar en estilos.

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!