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

151
Vistas
Formik hidden field not showing up on submit and a way to set initial values dynamically

I'm using formik ArrayFields to generate a set of questions based on user input.

<Field
    type="hidden"
    value={something.text}
    name={`friends[${index}].something`}
/>
<Field
   type="hidden"
   value={something.type}
   name={`friends[${index}].type`}
/>
<Field
   className={classes.textField}
   component={TextField}
   label={something.text}
   value=" "
   name={`friends[${index}].somethinelse`}
/>

on submit I want the hidden fields to show as {name:value} how would I do that as that is currently not how they work. Also I would like a way to have a default value for my fields to submit as if they are untouched at the moment having a value = " " does not allow me to edit the field; onChange = "formik.handleChange" does not work as well, on change returns as undefined will post the exact error if someone is interested. thanks for any help

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I fixed this by populating the formik values before rendering the fields with dummy data

about 4 years ago · Juan Pablo Isaza Denunciar
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