Releases: Morglod/react-virtual-overflow
Releases · Morglod/react-virtual-overflow
1.1.2 infinity loader example
- Hooks now also return
itemSlice
Example infinity loader:
const [items, setItems] = useState([] as any[]);
// here we get current rendered itemSlice
const { renderedItems, itemSlice } = useVirtualOverflowY({
itemsLengthY: items.length,
// ...
});
// here we check if we render bottom range of items
useEffect(() => {
if (itemSlice.topStartIndex + itemSlice.lengthY >= items.length - 4) {
// load more
setItems((prev) => [...prev, ...newItems]);
}
}, [itemSlice.topStartIndex, itemSlice.lengthY]);
1.1.0 list & grid support
- Added components for vertical / horizontal lists and grid
- Updated documentation
- Added more examples
- Added ability to force update calculations