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

211
Vistas
How to Print async function return in react native?

I want to console my function and I hope I can make this function to go not in only 1 file

let's say my code is like this

const insertMember = async (v) => {
  const member = [];
  await Promise.all(v.map(async (evalue) => {
    const result = await HttpHelper.get(`${api.usersUrl}?filter-email=${evalue.email}`);
    const value = result?.data?.data[0]?.avatar?.url?.small;
    const obj = {
      nik: evalue?.nik,
      name: evalue?.name,
      position: evalue?.position,
      external: evalue?.isExternal,
      email: evalue.email,
      avatar: value,
    };
    member.push(obj);
  }));
  setInternal(member);
  return member;
};

and when I check with my useEffect

useEffect(() => {
  insertMember(description?.partnerSelection?.recipients)
    .then((data) => console.log('MY DATA', data));
}, []);

it only shows MY DATA []

What should I do to make the console show the result? The setter working successfully, but in this case I want to see what make the console empty array

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