Home > Blockchain >  How to show Flatlist item separator component on bottom
How to show Flatlist item separator component on bottom

Time:12-27

I have some items in a flatList in which I have used itemSeparator component to show the divider between the list but by default flatList render divider in between items, and I need to show the divider to the bottom also, is that any way to do this.

Thanks in advance

I have tried with index but that is not working on the flatList item separator, and I do not want to customise item to show the bottom line of the item. so is it possible with item separator to show the bottom line.

CodePudding user response:

You can wrap your items to CellRendererComponent https://reactnative.dev/docs/virtualizedlist#cellrenderercomponent and apply styling to it

CodePudding user response:

You can add ListFooterComponent in flatlist and apply the same function which you have applied in ItemSeparatorComponent.

  <FlatList
        data={DATA}
        renderItem={renderItem}
        ItemSeparatorComponent={<ItemSeparatorComponent/>}
        ListFooterComponent={<ItemSeparatorComponent/>} 
  />
  • Related