chroma-react
chroma-react copied to clipboard
Supports Infinite query data of tanstack query in Infinitescroll component
Now
it only supports a flat array items in the <InfiniteScroll />
component.
Expected result
Supports InfiniteData
type from @tanstack/react-query
to reduce developer's effort to transform paged data into a flat array
The key thing I've learned from the TanStack table virtualized infinite scrolling example is it uses React.useMemo
hook to keep a flat array of arrays from the useInfiniteQuery
hook so that it could be used in TanStack table (or the InfiniteScroll component). see https://github.com/TanStack/table/blob/ac48ff768a44d0c379b5f36d98e5f90e8018e1b7/examples/react/virtualized-infinite-scrolling/src/main.tsx#L80-L100
So I think the result of this issue is contributing a new story on how to use useInfiniteQuery
with <Infinitescroll />