我通过道具发送数组通过道具,但我不能使用阵列上的地图。它说,不能使用通过道具发送的数组
.MAP不是一个函数
我的代码:
const AuthorList = (authors) => {
return(
<table className="table">
<thead>
<tr>Firstname</tr>
<tr>Lastname</tr>
</thead>
<tbody>
{authors.map(author =>
<AuthorListRow key={author.id} author={author} />
)}
</tbody>
</table>
);
};
这就是Chrome的开发做出反应工具的样子:
非常感谢!我知道为什么它不工作,这是失去{},只从道具提取作者。谢谢! –