-2

Hereby attached my data

{
  pageOfItems: [
    {
      __v: 0,
      _id: "5f10121efb43a43e30a4fbd2",
      brand: [Object],
      category: [Object],
      color: [Array],
      createdAt: "2020-07-16T08:38:37.787Z",
      description: "Full Sleeves, Na, Na",
      discountType: "Percentage",
      discountValue: 50.07153075822603,
      fabric: null,
      gender: [Object],
      itemcode: "MW4405",
      name: "Moda Grey Casual Shirts",
      photo: [Array],
      price: 699,
      quantity: 10,
      rotation: 0,
      shipping: true,
      size: [Array],
      sleeves: "5f0ffa443c7e14330408c285",
      sold: 0,
      status: "ON",
      store: "5f10119dbfe6ec3e38b0a71b",
      subcategory: "5f04732469c00914e0bb905c",
      updatedAt: "2020-07-16T08:38:37.787Z",
    },
  ],
};

how to get in flatlist in please tell me

Ketan Ramteke
  • 10,183
  • 2
  • 21
  • 41
Andruroshan
  • 113
  • 1
  • 2
  • 11

1 Answers1

0

Try this

const obj = {
  pageOfItems: [...],
};


<FlatList
  data={obj.pageOfItems}
  renderItem={({ item, index}) => (
    <View>
        <Text>{item.name}</Text>
    </View>
  )}
  keyExtractor={(item,index) => index.toString()}
/>
Nooruddin Lakhani
  • 7,507
  • 2
  • 19
  • 39