import type { ComponentType, LazyExoticComponent } from "react"; /** * Same as React's lazy(), except that if the fallback is rendered in the * Suspense, this guarantees that it will be rendered for a minimum duration (1 * second by default). This is useful when showing temporary content spinners, * progress indicators, skeletons, etc. Although it seems counterintuitive to * delay showing the real content longer than necessary, showing these temporary * placeholders for too short a duration causes a quick "flash" of content * change that can be disorienting. Showing them for a minimum duration allows * the user to understand what is happening. * * @param factory Produces a promise of the real component to show. * @param minDuration = The minimum amount of time (in milliseconds) that must * elapse before the promise will resolve. This will NOT be applied when * invoking preload(). */ export default function lazyWithMinimumDuration>(factory: () => Promise<{ default: T; }>, minDuration?: number): LazyExoticComponent;