An open API service indexing awesome lists of open source software.

https://github.com/faustienf/react-feed

◽🔲◽ Rendering part of large list components
https://github.com/faustienf/react-feed

feed react react-feed react-virtualized react-window virtual-list virtualization

Last synced: 27 days ago
JSON representation

◽🔲◽ Rendering part of large list components

Awesome Lists containing this project

README

          

# react-feed



## Hook API

```tsx
const [startIndex, setStartIndex] = useState(0);
const ref = useRef(null);

const { style } = useFeed(ref, {
startIndex,
onReadHeight: (el) => el.offsetHeight,
onReadScrollTop: () => document.scrollingElement.scrollTop,
onChangeStartIndex: setStartIndex,
});


{items.slice(startIndex, startIndex + 10).map((item) => (

))}

```

## Component API

```tsx
const [startIndex, setStartIndex] = useState(0);

el.offsetHeight}
onReadScrollTop={() => document.scrollingElement.scrollTop}
onChangeStartIndex={setStartIndex}
>
{items.slice(startIndex, startIndex + 10).map((item) => (

))}

```