diff --git a/src/components/lab/Virtualizer/Virtualizer.tsx b/src/components/lab/Virtualizer/Virtualizer.tsx index 886a3925d..1dfeb2b42 100644 --- a/src/components/lab/Virtualizer/Virtualizer.tsx +++ b/src/components/lab/Virtualizer/Virtualizer.tsx @@ -12,9 +12,9 @@ import {defaultRangeExtractor, useVirtualizer} from '@tanstack/react-virtual'; import {useForkRef} from '../../../hooks'; import type {Key} from '../../types'; -import type {Loadable} from '../Collection/Collection'; import {useLoadMore} from './useLoadMore'; +import type {Loadable} from './useLoadMore'; type Item = {index: number; key: Key}; diff --git a/src/components/lab/Virtualizer/useLoadMore.tsx b/src/components/lab/Virtualizer/useLoadMore.tsx index 4903496e3..949fc1da9 100644 --- a/src/components/lab/Virtualizer/useLoadMore.tsx +++ b/src/components/lab/Virtualizer/useLoadMore.tsx @@ -1,10 +1,13 @@ import React from 'react'; -interface LoadMoreOptions { - /** Whether the data is currently loading. */ +export interface Loadable { + /** Whether the items are currently loading. */ loading?: boolean; /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */ onLoadMore?: () => void; +} + +export interface LoadMoreOptions extends Loadable { /** * The amount of offset from bottom that should trigger load more. * The value is multiplied to the size of the visible area.