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

115
Vistas
Cant figure out what is going wrong while using formik

consider the following code:

const handleEmployeeNumberChange = async (e, value, name) => {
        if (name === 'Employee Number') {
            const employee = await employeeServices.getByNumber(value);
            formik.setFieldValue('Employee Name', employee['Personal Information']['Employee Name']);
            formik.setFieldValue('Designation', employee.Company.Designation);
            console.log(employee.Company.Designation);
            formik.setFieldValue('Department', employee.Company.Department);
            const element = { target: { name, value } };
            formik.handleChange(element);
        }
    };

Some useful information:
The setFieldValue for the Department is working as expected, but not working for Designation. it is setting "" as the value, I logged the value of employee.Company.Designation and it is what is expected. I will post a small clip below for more clarity:

https://imgur.com/a/6Oduo7Z

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