stream-chat-react
Version:
React components to create chat conversations or livestream style chat
26 lines • 1.5 kB
TypeScript
import type { PropsWithChildren } from 'react';
import React from 'react';
import type { PaginatorProps } from '../../types/types';
export type InfiniteScrollProps = PaginatorProps & {
className?: string;
element?: React.ElementType;
/** Element to be rendered at the top of the thread message list. By default, Message and ThreadStart components */
head?: React.ReactNode;
initialLoad?: boolean;
isLoading?: boolean;
listenToScroll?: (offset: number, reverseOffset: number, threshold: number) => void;
loader?: React.ReactNode;
useCapture?: boolean;
};
/**
* This component serves a single purpose - load more items on scroll inside the MessageList component
* It is not a general purpose infinite scroll controller, because:
* 1. It is re-rendered whenever queryInProgress, hasNext, hasPrev changes. This can lead to scrollListener to have stale data.
* 2. It pretends to invoke scrollListener on resize event even though this event is emitted only on window resize. It should
* rather use ResizeObserver. But then again, it ResizeObserver would invoke a stale version of scrollListener.
*
* In general, the infinite scroll controller should not aim for checking the loading state and whether there is more data to load.
* That should be controlled by the loading function.
*/
export declare const InfiniteScroll: (props: PropsWithChildren<InfiniteScrollProps>) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=InfiniteScroll.d.ts.map