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

275
Visualizações
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 à 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