【发布时间】:2019-04-11 06:07:50
【问题描述】:
我正在从 Firestore 获取数据。当我 console.log 收到的结果时,一切看起来都很好,但是当我尝试显示它们时,我得到了这个错误:
未捕获的不变违规:对象作为 React 子级无效(发现:>带有键 {seconds, nanoseconds} 的对象)
console.log(props.transactions) 结果:
{props.transactions &&
props.transactions
.map(transaction => {
return (
<tr key={transaction.id}>
<td>{transaction.date}</td>
<td>{transaction.description}</td>
<td>{transaction.category}</td>
<Cell transactionType={transaction.transactionType}>
{transaction.amount}
</Cell>
<td>
<Button>Edit</Button>
</td>
</tr>
)
})
}
【问题讨论】:
标签: reactjs google-cloud-firestore components