Skip to content Skip to sidebar Skip to footer

React Native Flatlist With Several Arrays Of Data

I'M new to RN and need some help I have an object like {title:'title',price:'price',subtitle:'subtitle'} And I'd like to use 2 values at flatlist, like here -

Solution 1:

You have to pass an array into the data property, then you can do:

<FlatList
    data={this.state.data}
    renderItem={({ item }) => ( //this part will iterate over every item in the array and return a listItem
      <ListItem
        key={item.id}
        title={item.title}
        price={item.price}
     />
    )}

  />
</List>

Post a Comment for "React Native Flatlist With Several Arrays Of Data"