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

145
Visualizações
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 Respostas
Responde à pergunta

0

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

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