RenderApplicationOptions
Configure streamed document rendering.
Compatibility
Import from @kasperrt/smolter/react/server @kasperrt/smolter/preact/server
Signature
interface RenderApplicationOptions {
nonce?: string;
earlyHydration?: boolean;
}Fields
nonce applies to the streaming hydration scripts. Use the same nonce on Scripts and in the document Content-Security-Policy. Preact SSR requires preact-render-to-string 6.8.1 or newer. React application SSR requires React DOM 19+.
return renderApplication(request, routes, root, entry, { nonce });Early hydration
earlyHydration defaults to false. Set it to true to run the async browser entry after the initial shell arrives, while optional loader promises are pending. Use Await with an explicit fallback or inside Preact Suspense. Smolter application outlets preserve root boundaries and invalidate abandoned route stream markers after another component commits. Keep the same CSP nonce on Scripts and this renderer. Critical loader data still completes before the shell. Streamed value/error packets are an internal protocol; do not edit the hydration payload or inject application-owned body nodes. React uses use(promise) inside native Suspense boundaries instead of the Preact Await helper.
return renderApplication(request, routes, root, entry, {
earlyHydration: true,
nonce,
});Fields
nonce
nonce?: string;earlyHydration
earlyHydration?: boolean;