chroma-react icon indicating copy to clipboard operation
chroma-react copied to clipboard

Supports Infinite query data of tanstack query in Infinitescroll component

Open shawnzhu opened this issue 1 year ago • 1 comments

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

shawnzhu avatar Jul 28 '23 22:07 shawnzhu

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 />

shawnzhu avatar Jul 31 '23 18:07 shawnzhu