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

142
Views
How to dynamically render jsx with objects values

Data is an array object. I want to render table columns dynamically according to data object. I used this same technique to generate table head its working. Is there any way to fix this issue?

const DataTable = ({data, deleteHandler, loading, tableFields}) => {

    const thead = [];
    const tbody = [];

    const [values, setValues] = useState({});

    for (const [key, value] of Object.entries(tableFields)) {
        thead.push(<td>{value}</td>);
    }

    data.map((field) => {
        for(const[key,value] of Object.entries(field)){
            tbody.push(
                <tr>
                    <td>{value}</td>
                </tr>
            );
        }
    })

    return (
        <Fragment>
            <Card className={classes.__bk_admin_card}>
                <Table borderless hover className={classes.__bk_admin_table}>
                    <thead>
                        <tr>
                            {thead}
                        </tr>
                    </thead>
                    <tbody>
                        {tbody}
                    </tbody>
                </Table>

            </Card>
        </Fragment>
    )
}
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!