0.0.3 • Published 3 years ago

@discovery-solutions/react-flatlist v0.0.3

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

Discovery Solutions - React FlatList

A FlatList ReactJS Component For Large Lists

npm i @discovery-solutions/react-flatlist

Conteúdo

Utilização Padrão

A primeira coisa a ser feita é instanciar o provider, assim:

import React from "react";
import FlatList from "@discovery-solutions/react-flatlist";

const App = () => (
    <FlatList
        data={[ 1, 2, 3, 4, 5 ]}
        renderItem={({ item }) => (
            <p>{ item }</p>
        )}
    />
)

export default App;

APIs suportadas

nametypedefaultdescription
dataarray[].
renderItemfunction() => null.
onTopReachedfunction() => nullwhen flatlist is scrolled to the top
onEndReachedfunction() => nullwhen flatlist is scrolled to the bottom
initialNumToRendernumber30.
ListEmptyComponentcomponent/node/functionnullrender when data is an empty array
ListHeaderComponentcomponent/node/functionnull.
ListHeaderComponentStylestyle objectnull.
ListFooterComponentcomponent/node/functionnull.
ListFooterComponentStylestyle objectnull.
Componentcomponent / functiondivthis is a custom component for the flatlist container