实际上,我正在尝试从产品列表页面中列出的产品中获取详细信息页面的产品详细信息,但是在此行href
:/product?_id=${product._id}
function ProductList({ products }) {
function mapProductsToItems(products) {
return products.products.map(product => ({
header: product.name,image: product.mediaUrl,meta: `$${product.price}`,color: 'teal',fluid: true,childkey: product._id,href: `/product?_id=${product._id}`
}));
}
}
这就是我遇到的错误:
对象作为React子对象无效(找到:[object Promise])。如果要渲染子级集合,请改用数组。在div中的Unknown中(在_app.js:19处)在容器中(在Layout.js:22)在Fragment中在Layout中的片段(在_app.js:18)在MyApp中在Context.Provider中在Context.Provider中在Context.Provider中在Context中AppContainer中的.Provider 不变违规:对象作为React子对象无效(找到:[object Promise])。如果要渲染子级集合,请改用数组。