Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
How to access checked property of a material UI <Checkbox/> and set it equal to false when pressing another icon (delete icon)?

I hope you are all doing great! I have a question and it would be amazing if someone could give me some information or direction on how to tackle my problem.

My problem is how to access the checked property of a material-ui <Checkbox checked={}/> component and set it equal to false or in other words, toggle it off when pressing a button. My problem is that the delete icon (button) exists in another file which means it is a different component. Furthermore, the button's onClick={} event has a property onClearSelected which is responsible of erasing strings inside looking like cells.

Further, I hope that I gave you some insight and I did not confuse you further. I would be glad to answer to any questions and I am sorry in advance if it is hard for you to understand what I am trying to imply.

Sincerely, Nikolaos

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

To manipulate checkbox you can simply use a ref, see useRef() in React docs.

To make a component alter something in a different component by a button click, you need to declare the ref in their common parent, then pass the ref to checkbox, either with prop drilling or a context.

Also in the parent component, create a function that unchecks the checkbox. Pass it down to the button, again with either prop drilling or with a context.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda