Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
Reset individual form input without re-rendering entire app in React?

My app gets initialized with a json payload of 'original values' for attributes in a task form. There is a shared state submissionState between various components in the app as children of a context provider which is a copy of the original values json but includes any edits made to attributes in the form. I would like to include individual 'reset' buttons for each input of the form which would update submissionState by setting the value for that input field to the original value in the json payload.

Code here: https://codesandbox.io/s/infallible-smoke-wtom9m

However, whenever I implement a reset button on a form input the entire app resets, even if I use e.preventDefault. Am I calling prevent default wrong and I just cant see the console error because the app is reseting?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda