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

276
Vistas
cannot add property x, object is not extensible

I am trying to write a function that adds an object to an formik FieldArray. I am not using preventExtensions func and I also tried making a copy of the object from a different solution I found but nothing has worked in resolving this error. Does anyone know how to add this object and avoid this error?

const handleDropDownValueCheck = (e: any) => {
    const propertyFileIndex: number = e.target.value;
    const propertyInformation: object = {
      address: PropertyFiles[propertyFileIndex]?.address as string,
      property_file_id: PropertyFiles[propertyFileIndex]
        ?.property_file_id as string,
      property_file_name: PropertyFiles[propertyFileIndex]
        ?.property_file_name as string,
      property_id: propertyListItem?.id,
    };

    selectedProperties?.find((propertyMapping, i) => {
      if (propertyMapping.property_id === propertyListItem?.id) {
        selectedProperties[i] = propertyInformation;
      }
    });

    const propertyInformationCopy = Object.assign([], propertyInformation);

    selectedProperties?.push(propertyInformationCopy);

    arrayHelpers.push(selectedProperties);
  };
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