renderToStringAsync
Renders a component tree to an HTML string and awaits all async reads in the
subtree before resolving. The returned HTML reflects the fully-settled state
ā no <Loading> fallbacks appear in the output.
Use this when you want a complete page in one round-trip. For incremental
streaming with progressive boundary resolution, use renderToStream.
Import
import { renderToStringAsync } from "@solidjs/web";Type signature
function renderToStringAsync<T>( fn: () => T, options?: { timeoutMs?: number; nonce?: string; renderId?: string; noScripts?: boolean; plugins?: any[]; manifest?: Record< string, { file: string; css?: string[]; isEntry?: boolean; isDynamicEntry?: boolean; imports?: string[]; } >; onError?: (err: any) => void; }): Promise<string>;Examples
import { renderToStringAsync } from "@solidjs/web";
const html = await renderToStringAsync(() => <App />);