ServerSsrContext
import { ServerSsrContext } from '@dr.pogodin/react-utils';
The ServerSsrContext class extends SsrContext class from the React Global State library; it is used by React Utils server() factory as a part of SSR setup.
Generic Parameters
StateT
— The type of global state object.
Properties
chunkGroups
— ChunkGroupsTchunks
— string[] — Defaults empty array.req
— Request — ExpressJS request being handled.status
— number — HTTP status for the response. Defaults 200 (OK).
Methods
constructor()
constructor(req: Request, chunkGroups: ChunkGroupsT, initialState?: StateT)
Creates a new ServerSsrContext instance.
Arguments
res
— RequestchunkGroups
— ChunkGroupsTinitialState
— StateT — Optional. Initial global state value.