第一次反应用户(在这里学习 FE)
当我尝试创建表时,我收到这些错误,因此我的表不会填充我尝试通过 API 获取的数据。
我在控制台中收到的错误消息:
Warning: validateDOMNesting(...): <thead> cannot appear as a child of <div>. Warning: validateDOMNesting(...): <tbody> cannot appear as a child of <div>.
我的代码:
<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?
MYYA
相关分类