Skip to main content

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

  • chunkGroupsChunkGroupsT
  • chunksstring[] — Defaults empty array.
  • reqRequest — ExpressJS request being handled.
  • statusnumber — HTTP status for the response. Defaults 200 (OK).

Methods

constructor()

constructor(req: Request, chunkGroups: ChunkGroupsT, initialState?: StateT)

Creates a new ServerSsrContext instance.

Arguments

  • resRequest
  • chunkGroupsChunkGroupsT
  • initialStateStateT — Optional. Initial global state value.