@suspensive/react
Version:
Suspensive interfaces for react
34 lines (33 loc) • 1.18 kB
text/typescript
import { PropsWithoutChildren } from "./utility-types/PropsWithoutChildren.mjs";
import { ComponentProps, ComponentType, ReactNode } from "react";
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
//#region src/Delay.d.ts
type DelayProps = {
ms?: number;
fallback?: never;
children?: ({
isDelayed
}: {
isDelayed: boolean;
}) => ReactNode;
} | {
ms?: number;
fallback?: ReactNode;
children?: ReactNode;
};
/**
* This component delays the rendering of its children for a specified duration.
*
* The Delay component provides a way to introduce intentional delays in rendering,
* which can be useful for loading states or animations.
* @see {@link https://suspensive.org/docs/react/Delay Suspensive Docs}
*/
declare const Delay: ((props: DelayProps) => _$react_jsx_runtime0.JSX.Element) & {
displayName: string;
with: <TProps extends ComponentProps<ComponentType> = Record<string, never>>(delayProps: PropsWithoutChildren<DelayProps>, Component: ComponentType<TProps>) => ((props: TProps) => _$react_jsx_runtime0.JSX.Element) & {
displayName: string;
};
};
//#endregion
export { Delay, DelayProps };
//# sourceMappingURL=Delay.d.mts.map