https://github.com/ulisse1996/drssr
A simple Deno dependency for React Server Side Rendering
https://github.com/ulisse1996/drssr
Last synced: 4 months ago
JSON representation
A simple Deno dependency for React Server Side Rendering
- Host: GitHub
- URL: https://github.com/ulisse1996/drssr
- Owner: ulisse1996
- License: mit
- Created: 2020-06-25T13:13:56.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-25T13:33:32.000Z (about 5 years ago)
- Last Synced: 2025-01-20T14:53:17.548Z (6 months ago)
- Language: TypeScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'
```