I've created a reusable table in React. My problem is on the display of the data from the other page.
I need to get the value for it to be displayed in <TableCell>
Pls see this code sandbox link
return (
<Paper className={classes.root}>
<TableContainer className={classes.container}>
<Table stickyHeader aria-label="sticky table">
<TableHead>
<TableRow>
{tableHeaders.map((header, index) => (
<TableCell key={index}>{header}</TableCell>
))}
</TableRow>
</TableHead>
<TableBody>
{data.map(data => (
<TableRow key={data.id}>
{tableBodies.map(body => (
<TableCell key={body}>{`data.${body}`}</TableCell>
))}
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</Paper>
);