RenderApp

tcmts.cli.web.RenderApp · #nywnntp7 · type

Render the app's page on the server, streaming it into res: its HTML in #app, then the server component trees it rendered, which the browser hydrates with. Returns false, having written nothing, when the page can't render on the server (it then renders in the browser).

export type RenderApp = (
  write: (html: string) => void,
  onError: (e: unknown) => void,
  /** what the page will need (its `Link` header: what it preloads), as React finds it, before the shell is ready */
  onHeaders?: (headers: Headers) => void,
) => Promise<{ done: Promise<void> }>;

used by