This commit is contained in:
Tomas Dvorak
2026-02-24 10:33:59 +01:00
parent 409acd2e08
commit 898a3c303f
1374 changed files with 290409 additions and 29187 deletions
@@ -0,0 +1,17 @@
{
"id": "92446eaffcb765afeb199a9c",
"source": "solid:signals",
"type": "github-document",
"title": "render-to-string-async",
"content": "---\ntitle: renderToStringAsync\nuse_cases: \u003e-\n ssr with async data, suspense resolution, complete page rendering, data\n serialization, seo optimization\ntags:\n - ssr\n - async\n - suspense\n - serialization\n - rendering\nversion: '1.0'\ndescription: \u003e-\n Render complete HTML with async data using renderToStringAsync. Waits for all\n Suspense boundaries before returning serialized results.\n---\n\n```ts\nimport { renderToStringAsync } from \"solid-js/web\"\n\nfunction renderToStringAsync\u003cT\u003e(\n\tfn: () =\u003e T,\n\toptions?: {\n\t\ttimeoutMs?: number\n\t\trenderId?: string\n\t\tnonce?: string\n\t}\n): Promise\u003cstring\u003e\n\n```\n\nSame as `renderToString` except that it will wait for all `\u003cSuspense\u003e` boundaries to resolve before returning the results.\nResource data is automatically serialized into the script tag and will be hydrated on client load.\n\n`renderId` is used to namespace renders when having multiple top level roots.\n\n```ts\nconst html = await renderToStringAsync(App)\n```\n\n## Options\n\n| Name | Type | Description |\n| ----------- | -------- | -------------------------------------------------------------------------------------------- |\n| `timeoutMs` | `number` | The number of milliseconds to wait for a `\u003cSuspense\u003e` boundary to resolve before timing out. |\n| `renderId` | `string` | The id to use for the render. |\n| `nonce` | `string` | The nonce to use for the script tag. |",
"url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/reference/rendering/render-to-string-async.mdx",
"metadata": {
"path": "src/routes/reference/rendering/render-to-string-async.mdx",
"repo": "solidjs/solid-docs",
"repo_url": "https://github.com/solidjs/solid-docs.git",
"size": 1581,
"source_type": "github"
},
"hash": "5f60d56320a9d3d34e01e64186c9c67eaaf0609976c2dd3c529b218dbdb3ae17",
"timestamp": "2026-02-23T11:43:00.190429731+01:00"
}