【发布时间】:2021-08-24 10:32:48
【问题描述】:
我目前无法将一组对象渲染到我的 react 本机平面列表中。
这是我的数组:
const item = [
{
"id": 59,
"id_order": Object {
"created": "23/08/2021 16:37:55",
"direccion_extra": "codigo: 0592",
"id": 39,
"id_cliente": 35,
"monto_pago_efectivo": null,
"status": 1,
"tipo_pago": 2,
},
},
{
"id": 58,
"id_order": Object {
"created": "23/08/2021 16:37:55",
"direccion_extra": "codigo: 0592",
"id": 39,
"id_cliente": 35,
"monto_pago_efectivo": null,
"status": 1,
"tipo_pago": 2,
},
},
]
这是我要渲染的平面列表:
<FlatList
data={item}
renderItem={({ itemProduct, index }) => <ProductCard item={{itemProduct}} />}}
keyExtractor={(item, index) => index.toString()}
/>
但是,我无法接收 ProductCard 组件中的每个数组对象。任何想法表示赞赏!
【问题讨论】:
标签: react-native