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

125
Vistas
data from object not rendering in any component in react native

i created a use effect hook to fetch data from an api and set it to a variable like this:

 const [rich, setData] = useState([]);
  useEffect(() => {
    fetch('http://api.mediastack.com/v1/news?access_key=API_KEY&languages=en&countries=us,gb,ng,-ma,-ar,-qa,-sd')
      .then((response) => response.json())
      .then((json) => setData(json))
      .catch((error) => console.error(error))
      .finally(() => setLoading(false));
  }, []);

after that i tried to render the data out on the screen like this:

<View> {
          rich.data.forEach(item => {
            console.log(item.author);
            <Text>{`data: ${item.author}`}</Text>
            
          })

          }
     </View>

now the issue is that the console.log works but if i put it in the text component like i did, it wouldn't display.

about 4 years ago · Juan Pablo Isaza
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