Estoy tratando de escribir una función que agregue un objeto a un FieldArray formik. No estoy usando la función preventExtensions y también intenté hacer una copia del objeto desde una solución diferente que encontré, pero nada funcionó para resolver este error. ¿Alguien sabe cómo agregar este objeto y evitar este 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); };