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

113
Visualizações
how to prevent list item change realtime with onchange method

I have a list that show some item, and they have Edit button beside the field, when you click the Edit button, it will show the modal that show name of the item where you can edit the name of the item. But the problem is when I try to change the name from the modal, the selected item from the list is changed too, before I click the save button.

Codesandbox

Thank you in advance.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Don't change the parent state from the modal, create a local state in modal and pass it on to the parent in the onClose callback and then change the state in parent.

Demo: https://codesandbox.io/s/gifted-knuth-ik0ed

about 4 years ago · Santiago Trujillo 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