2.0.0 • Published 6 years ago

react-kits-server v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

react-kits-server

Express server for server-side rendering with data prefetching.

Install

yarn add react-kits-server

API

import { createReactServer } from 'react-kits-server'

import createStore from '../store/createStore'
import { getInitialData } from '../routes'
import { HOME_PATH, ASSET_URL } from '../url'
import CoreLayout from '../layouts/CoreLayout'

const app = createReactServer({
  createStore,
  getInitialData,
  homePath: HOME_PATH,
  assetUrl: ASSET_URL,
  customMiddleware: expressIns => {},
  onRender: () => <CoreLayout />
})

/**
 * `createStore` is a function that must return Redux store.
 * `getInitialData` is a function that must return Promise.
 * `onRender` is a function that must return React element.
 **/

License

MIT

4.0.0-alpha.0

6 years ago

3.0.0-alpha.5

7 years ago

3.0.0-alpha.4

7 years ago

3.0.0-alpha.3

7 years ago

3.0.0-alpha.2

7 years ago

3.0.0-alpha.1

7 years ago

3.0.0-alpha.0

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago

1.0.0-alpha.1

7 years ago

1.0.0-alpha.0

7 years ago

1.0.0-1

7 years ago

1.0.0-0

7 years ago

0.13.0

7 years ago

0.12.0

7 years ago

0.11.0

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.4

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago