class SsrService
implements ISsrService
Since 0.1.0

Implements ISsrService.

Holds the resolved RR request handler, the factory for its per-request context provider, and the optional populateLoadContext hook, and delegates render() to the request bridge.

Constructors

SsrService(
createLoadContext: () => RouterLoadContext,
populateLoadContext: PopulateLoadContext | undefined
)
Parameters

The resolved RR request handler

createLoadContext: () => RouterLoadContext

Factory for the per-request context provider, sourced from the same react-router module as handler

populateLoadContext: PopulateLoadContext | undefined

Optional hook adding app values to the context

Methods

Since 0.1.0
render(ctx: IRequestContext): Promise<HandlerResult>

Renders an SSR document for the given request context.

Usage

import { SsrService } from "react-router-plugin/src/index.ts";