1.0.9 • Published 1 year ago

react-infinite-list-observer v1.0.9

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

react-infinite-list-observer

Demo

Playground here

install

npm install react-infinite-list-observer

or

yarn add react-infinite-list-observer

usage

const listRef = useRef<ListHandler>(null);

const onSomething = () => {
         if (listRef.current) {
            listRef.current.resetPage();
            listRef.current.scrollToTop();
          }
]

 <List
        ref={listRef}
        hasMore={hasMore}
        list={items}
        height={400} // optional
        onFetchMore={fetchMore}
        renderItem={(item) => {
          return (
           <div key={item.id}>{item.name}</div>
          );
        }}
      />

#props

Propdescription
listT
renderItemmethod returns JSX
hasMoreboolean
onFetchMoremethod used to fetch more data
currentPageoptional - number
heightoptional - number
classNameused for styling
refoptional: attach ref - allows you to reset the page / scroll to top
1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago