Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 775 Bytes

File metadata and controls

31 lines (24 loc) · 775 Bytes
title renderToString
function renderToString<T>(
	fn: () => T,
	options?: {
		nonce?: string
		renderId?: string
	}
): string

Renders to a string synchronously. The function also generates a script tag for progressive hydration. Options include eventNames to listen to before the page loads and play back on hydration, and nonce to put on the script tag.

renderId is used to namespace renders when having multiple top level roots.

const html = renderToString(App)

Options

Name Type Description
nonce string The nonce to use for the script tag.
renderId string The id to use for the script tag.