@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
25 lines • 1.3 kB
text/typescript
import * as React from 'react';
import type { ChunkComponentProps, CreateChunkConfig } from "./types.mjs";
/**
* Server render path for a chunk: an async server component that produces the
* content on the server, to be rendered under a Suspense boundary so React
* streams the fallback until it resolves (per-chunk Suspense). It is a plain
* async render function (no Node-only imports), so it bundles harmlessly with
* the client surface - it just never runs there.
*
* With `initial`, it renders the server `InitialLoader` (the quick initial
* state). Otherwise it prefers the server `Loader` component (dynamically
* imported, never shipped to the client), falling back to a server-side
* `data`-mode `load`. When none applies it renders the loading placeholder (the
* client then takes over).
*
* Readiness/coordination is a client concern, so there is no gate here - the
* parent Suspense owns the fallback, and the streamed content hydrates into the
* client swap.
*/
export declare function ChunkServerLoader<T extends {}, P, O>(args: {
config: CreateChunkConfig<T, P, O>;
props?: ChunkComponentProps<T, P, O>;
/** Render the server `InitialLoader` (the quick initial state) instead of the full `Loader`. */
initial?: boolean;
}): Promise<React.ReactElement | null>;