Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!