forgo-ssr
v2.0.0
Published
Allows you to render a [forgo component](https://forgojs.org) into a string.
Downloads
27
Readme
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 />);