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

381
Vistas
TextField not editable due to Uncaught TypeError: is not iterable

I am pulling data from an API and appending it to TextFields where it is displayed. I need to be able to edit the data displayed in TextFields, but I a get this Uncaught TypeError: prev.fields is not iterable when I try to edit or add any text to the TextFields.

This is how the TextField is populated:

{details["groups"]?.map((group) => {
    return (
        {group["fields"]?.map((row, index) => {
            return (
                <TextField
                    value={row?.Value || ""}
                    onChange={(e) => {
                        setDetails((prev) => {
                            const update = [...prev.fields];
                            update[index] = {
                                ...update[index],
                                Value: e.target.value,
                            };
                            return { ...prev, fields: update };
                        });
                    }}
                    label={row["FieldName"]}
                />
            );
        })}
    );
})}

This is my API request:

const fetchDetails = async () => {
    setDetails(await fetch(`/fiscalyears/FY2023/intakes/${params.id}/details`)
        .then((response) => response.json()));
};

This is an example of my data:

{
  "groups": [
    "GroupName": "Solution Details",
    "GroupOrder": 1,
    "fields": [
      {
        "FieldId": 19,
        "FieldOrder": 1,
        "FieldName": "Requesting Organization",
        "FieldType": "Text",
        "Value": "IT",
        "Choices": [
          null
        ]
      }
    ]
  ]
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This answer was provided by Chris G in his comment

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