我正在运行GrandStack.IO Grandstack repo中的 starterapp
一切都出现并呈现,但我收到警告:
Warning: Each child in a list should have a unique "key" prop.
Check the render method of `RecentReviews`.
in WithStyles(ForwardRef(TableRow)) (at RecentReviews.js:48)
in RecentReviews (at Dashboard.js:48)
我已经阅读了所有关于此的内容,这本质上意味着循环的组件应该具有唯一的 id。说得通。但是,第 48 行的表行确实有一个键
<TableBody>
{data.Review.map((row) => ( <--this is line 48
<TableRow key={row.id}>
<TableCell>{row.date.formatted}</TableCell>
<TableCell>{row.business.name}</TableCell>
<TableCell>{row.user.name}</TableCell>
<TableCell>{row.text}</TableCell>
<TableCell align="right">{row.stars}</TableCell>
</TableRow>
))}
</TableBody>
我到底错过了什么?