1.0.1 • Published 3 years ago

react-native-waterfall-layout-list v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

react-native-waterfall-layout-list

waterfall-layout-list. based in react native VirtualizedList

Setup

This library is available on npm or yarn, install it with: npm i react-native-waterfall-layout-list or yarn add react-native-waterfall-layout-list.

Usage

This is a convenience wrapper around , and thus inherits its props (as well as those of <ScrollView>)

  1. Import react-native-waterfall-layout-list:
import WaterfallList from 'react-native-waterfall-layout-list';

Example

<WaterFallList
        renderItem={renderItem}
        data={data}
        windowSize={5}
        keyExtractor={(item, index) => `${index}`}
        onEndReached={loadMoreData}
        ListFooterComponent={<ListFooter />}
        numColumns={2}
        getHeight={getHeight}
      />

For a more complex example take a look at the /Example directory.

Available props

NameTypeDefaultDescription
getItemHieght(item,index)=>numberget list-item height animation
numColumnsnumber1like Flatlist props but waterfall(masonry) layouts are no supported

Pull requests, feedbacks and suggestions are welcome!