UNPKG

427 BTypeScriptView Raw
1import * as React from "react";
2import container from "../config/container";
3import { ICore, IRenderOptions } from "../interfaces";
4import TYPES from "../types";
5
6export const ssr = ({
7 component, props,
8}) => (<div dangerouslySetInnerHTML={{ __html: render({
9 component,
10 props,
11})}} />);
12
13export function render(options: IRenderOptions) {
14 const core = container.get<ICore>(TYPES.ICore);
15 return core.render(options);
16}