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

123
Views
React Display Data in React Table

i have to display the Data coming from Async function in a Table. but it will only 4 Line displayed. enter image description here

i excpected 6 Line. please check the Result in Console.log(result) => enter image description here

my code :

mychange = async () => {
    // Use IPC API to query Electron's main thread and run this method
    const result = await window.api.getNetworkInterfaces()
    var myliste = [];
    
    console.log(result)
    for (const [key, value] of Object.entries(result)) {
        var entryNumber = 0;
        var i =0;
        //console.log(value.lenght)
        value.forEach(entry => {
          console.log(entry.lenght)
         
          myliste[i]={ id: i, selected: false, name: key, email: entry.family,phone:entry.address};
            i++;  
        })
    }
  ;
    this.setState({
        List:myliste
    })
    
  }

can someone help to lose the probleme ?

expected result : enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is a bug in your program. You are replacing your item in the second iteration of Object.entries(result). Your index i is reset to 0 after an iteration.

A suggested fix is the following, by putting the variable i outside the loop.

    var i =0;
    for (const [key, value] of Object.entries(result)) {
        value.forEach(entry => {         
            myliste[i] = { id: i, selected: false, name: key, email: entry.family, phone: entry.address };
            i++;  
        })
    }
about 4 years ago · Juan Pablo Isaza Report
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!