Skip to content

forgojs/forgo-ssr

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

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 />);

About

Server-side Rendering for Forgo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published