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

192
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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