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

197
Vistas
How to solve: Objects are not valid as a React child (found: object with keys {_U, _V, _W, _X}?

Im trying to map my state , but it allways returns me this error, someone knows how to solve it ?

 useEffect(() => {
    if (mounted && userForm.length > 0) {
      console.log(userForm, 'campos:', userForm.fields);
      return;
    } else {
      setuserForm(JSON.parse(route.params.paramKey));
      console.log(userForm);
    }
  }, [userForm]);

  return (
    <SafeAreaView style={{flex: 1}}>
      <View style={styles.container}>
        <Text style={styles.textStyle}>COLLECTION :</Text>



        {userForm.length > 0 ? (
          userForm.map((item) => (          
            <Text key={uuid.v4()}>{item.fields}</Text>
          ))
        ) : (
          <Text key={uuid.v4()}> Loading ...</Text>
        )}

      </View>
    </SafeAreaView>
  );
};

what I'm trying to do is render all my fields and then handle the following types.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If I understand you correctly, you are trying to render item.field as node. However, seems that this is an array, so you need to map it one more time. For example, if it contains strings it might looks like this:

  <Text key={uuid.v4()}>{item.fields?.concat('')}</Text>

In case filds contains objects you have to map it to the new component, like this:

  <Text key={uuid.v4()}>{item.fields?.map((field, i)=> <div key={i}>{field.someProp}</div>}</Text>

In case you don't know what is inside the fields, check the Network tab in the ChromeDeveloperTools (F12) or use JSON.stringify

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