Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ulisse1996/drssr

A simple Deno dependency for React Server Side Rendering
https://github.com/ulisse1996/drssr

Last synced: 2 days ago
JSON representation

A simple Deno dependency for React Server Side Rendering

Awesome Lists containing this project

README

        

# Deno React Sever Side Rendering

DRSSR is a simple dependency for convert a React Component in a plain string that can be injected in a HTML page. DRSSR also produce a simple or obfuscated chunk of code for hydrate React functionality for client side.

It can be used with a framework like [Oak](https://deno.land/x/oak) for create dynamic or static page.

### Example
```typescript
const app = () => {
return (


Hello World



)
}

const page = render();

const pageProd = render(, {production : true})

page.html(); // Return string representation of App component

page.script('app'); // Return js chunk of code for hydrate React component and attach this component to element identified by 'app'

pageProd.script('app'); // Return an obfuscate js chunk of code for hydrate React component and attach this component to element identified by 'app'

```