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

142
Vistas
Overwrite Values react-hook-form

I have a form that conditionally displays inputs.

What I have to do is display a table with values taken from a search of a database which is in a form. I have this part down, but the problem is saving it. I have to use react-hook-form getValues() to get the values of the form, including what is displayed on the table. To do this, I created hidden inputs with default values of what I need to save. This part works, but the problem occurs when the condition is no longer met, for some reason it still has the values of these inputs saved even though they should not exist.

Ex/

condition ? (
<Controller 
  controllerstuff....
  <input value="tabledata" hidden/>
/>
) : (
<Controller 
 controllerstuff...
 <input value="overwrite other stuff" hidden/>
/>
)

So, how can I overwrite/remove these values I do not need or what would be the best way to save the values from the search using getValues()? Thanks in advance.

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