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