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
- Host: GitHub
- URL: https://github.com/faustienf/react-feed
- Owner: faustienf
- Created: 2022-04-27T18:54:39.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-10T10:57:31.000Z (over 3 years ago)
- Last Synced: 2025-07-30T00:15:36.256Z (6 months ago)
- Topics: feed, react, react-feed, react-virtualized, react-window, virtual-list, virtualization
- Language: TypeScript
- Homepage: https://faustienf.github.io/react-feed
- Size: 2.43 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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) => (
))}
```