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

105
Visualizações
Submit button not giving required result

My submit button is not displaying output when i am pressing it but when i do a backspace it is giving me the output on the screen. enter image description here

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

0

Post code instead of posting images

According to the image that you have provided, inside saveTask you are pushing the obj to the taskList and then passing it to the state updating function. Arrays are of reference type and since here you are not passing a new array, react will figure out that the array hasn't changed (although you have appended the obj) and hence it won't trigger a re-render.

So change your code to this,

const saveTask = (taskObj) => {
      setTaskList(prevList => {
           prevList.push(taskObj) 
           return [...prevList]      
      })
}
about 4 years ago · Santiago Gelvez 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