Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ezekielchentnik/preact-no-ssr
A Preact component for skipping server side rendering (SSR) of components. This component helps render components on the server that make sense to be rendered above the fold or that only makes sense to render on client.
https://github.com/ezekielchentnik/preact-no-ssr
above-the-fold isomorphic preact progressive-web-app rollem rollup ssr universal-javascript
Last synced: 2 months ago
JSON representation
A Preact component for skipping server side rendering (SSR) of components. This component helps render components on the server that make sense to be rendered above the fold or that only makes sense to render on client.
- Host: GitHub
- URL: https://github.com/ezekielchentnik/preact-no-ssr
- Owner: ezekielchentnik
- License: mit
- Created: 2017-05-04T05:13:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-11T20:19:03.000Z (over 7 years ago)
- Last Synced: 2024-05-21T13:04:00.462Z (7 months ago)
- Topics: above-the-fold, isomorphic, preact, progressive-web-app, rollem, rollup, ssr, universal-javascript
- Language: JavaScript
- Size: 34.2 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-preact - Preact No SSR - Skip Server Side Rendering of Components. (Uncategorized / Uncategorized)
README
# `` _for [Preact]_
[![NPM](https://img.shields.io/npm/v/preact-no-ssr.svg)](https://www.npmjs.com/package/preact-no-ssr)
[![Travis](https://travis-ci.org/gufsky/preact-no-ssr.svg?branch=master)](https://travis-ci.org/gufsky/preact-no-ssr)A Preact component for skipping server side rendering (SSR) of components. This component helps render components on the server that make sense to be rendered above the fold or that only makes sense to render on client. Depending on your server side render, this can significantly boost performance.
#### [Demo](https://github.com/ezekielchentnik/preact-pwa)
---
## Usage Example
Install
```bash
npm i preact-no-ssr --save
```Wrap the components you do not want to render on server when using 'preact-render-to-string'
```js
import NoSsr from 'preact-no-ssr';} // placeholder to render on server, defaults to null
skip={false} // toggle on/off server render, defaults to true
>
Stuff to not render on server```
## Props
| Prop | Type | Description |
|---------------------|------------|---------------------|
| **`placeholder`** | _Function_ | Component to render on server
| **`skip`** | _Boolean_ | If `false`, renders on server### License
[MIT]
[Preact]: https://github.com/developit/preact
[MIT]: http://choosealicense.com/licenses/mit/