renderToStringAsync
Edit this pageimport { renderToStringAsync } from "solid-js/web"
function renderToStringAsync<T>( fn: () => T, options?: { timeoutMs?: number renderId?: string nonce?: string }): Promise<string>
Same as renderToString
except it will wait for all <Suspense>
boundaries to resolve before returning the results.
Resource data is automatically serialized into the script tag and will be hydrated on client load.
renderId
is used to namespace renders when having multiple top level roots.
const html = await renderToStringAsync(App)
Options
Name | Type | Description |
---|---|---|
timeoutMs | number | The number of milliseconds to wait for a <Suspense> boundary to resolve before timing out. |
renderId | string | The id to use for the render. |
nonce | string | The nonce to use for the script tag. |