@resourge/react-fetch
Version:
[](LICENSE)
35 lines (34 loc) • 1.41 kB
TypeScript
/**
* react-fetch v1.41.3
*
* Copyright (c) resourge.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import { type MutableRefObject, type ReactNode } from 'react';
import { type InfiniteLoadingReturn } from '../../hooks';
type RefreshControlProps<Data extends any[], FilterSearchParams extends Record<string, any> = Record<string, any>> = {
context: InfiniteLoadingReturn<Data, FilterSearchParams>;
detectionMargin?: string;
/**
* By default is false
*/
preload?: boolean;
renderComponent?: (props: {
isLastIncomplete: boolean;
onClick: () => void;
}) => ReactNode;
/**
* Determines the nearest scrolling parent (overflow container) by default.
* If no `root` is provided, it searches for the closest overflow parent, otherwise, it defaults to the `window`.
*/
root?: IntersectionObserverInit['root'] | MutableRefObject<IntersectionObserverInit['root']>;
};
/**
* Component to help useInfiniteScroll control the scroll
*/
declare function RefreshControl<Data extends any[], FilterSearchParams extends Record<string, any> = Record<string, any>>({ context, root, detectionMargin, renderComponent, preload }: RefreshControlProps<Data, FilterSearchParams>): import("react/jsx-runtime").JSX.Element;
export default RefreshControl;