first time react user (BE learning FE here)
when i try to create my table I am getting these errors, and as a result my table wont populate with the data I am trying to pull in via my API.
the error messages I am getting in the console:
Warning: validateDOMNesting(...): <thead> cannot appear as a child of <div>.
Warning: validateDOMNesting(...): <tbody> cannot appear as a child of <div>.
my code:
<Paper>
<Grid container>
<Grid item xs={6}>
<DCandidateForm />
</Grid>
<Grid item xs={6}>
<TableContainer>
<TableHead>
<TableRow>
<TableCell>Name</TableCell>
<TableCell>Mobile</TableCell>
<TableCell>Blood Group</TableCell>
</TableRow>
</TableHead>
<TableBody>
{
props.dCandidateList.map((record, index) => {
return (<TableRow key={index}>
<TableCell>{record.fullName}</TableCell>
<TableCell>{record.mobile}</TableCell>
<TableCell>{record.bloodGroup}</TableCell>
</TableRow>)
})
}
</TableBody>
</TableContainer>
</Grid>
</Grid>
</Paper>
note: I am using the @material-ui/core package for react.
Is it a problem with how i am structuring my table?