Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 126.96.36.199 release ready!
Owner and Founder. Opencart
In this blog, I am discussing the FlatList. Basically, FlatList is a react-native Component and use to load the list of data. It’s an easy way to make an efficient scrolling list of data. Not only is it efficient but it’s got an incredibly simple API to work with. If you’ve used or are familiar with the ListView component it’s very similar, just better in (almost) every way. Now ListView is deprecated on react-native.
FlatList has two major props to render the list of data. such as renderItem and data. renderItem is used for load your each Item View and data your list data set.
The feature of FlatList-
Dynamically changing ViewType-
FlatList uses key props to change View Type of its items such List to Grid. Also, one important thing that we need to change the no. of columns dynamically for Grid Type.
In Above Code snipped I have use List View and Grid View display of FlatList items. In Grid View use 2 columns and list View use 1 column. “this.state.isGrid” is changing according to the type of view after clicking the button. ListEmptyComponent props use for displaying my Empty component what List data is empty. onEndReached props use for pagination of list data and load second-page data when the user reached on the last item after scrolling.
View Of Layout –
Issues with FlatList- If I am using FlatList in my App I have faced one issue on Scrolling,
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.