Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 476 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 476 Bytes

Forgo Server Side Rendering

Allows you to render a forgo component into a string.

Installation

npm i forgo-ssr

Rendering to a string

This is quite simple really.

import render from "forgo-ssr";

// A forgo component.
function MyComponent() {
  return {
    render() {
      return <div>Hello world</div>;
    },
  };
}

// Get the html (string) and serve it via koa, express etc.
const html = render(<MyComponent />);