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

210
Vistas
How to use Formik's handleChange multiple times to change the same value?

I use Material-UI and Formik. I want that two input fields can edit a single value. In this case there is a TextField and a Slider and both of those inputs should allow to change the value for the perdiod. When I give both input fields the same id I get the following error message, which I kinda expected: Formik cannot determine which value to update

But is there a way to do that with Formik or do I need to write a custom handleChange function?

const formik = useFormik({
    initialValues: {
      period: 5,
    },
<OutlinedInput
 id="period"
 name="period"
 type="period"
 onChange={formik.handleChange}
 value={formik.values.period}
/>


<Slider 
  value={formik.values.period}
  aria-label="Default" 
  min={0}
  max={20}
  id="period"
  onChange={formik.handleChange}
/>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

dont give them the same id , but give them the same name

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