fl-react-server

11.0.0 • Public • Published

Server side renderer function for React, used in Frameworkstein apps

version MIT License PRs Welcome

createServerRenderer

Helper method that takes care of a bunch of boilerplate for rendering react components server side.

Usage:

import _ from 'lodash'
import { createServerRenderer } from 'fl-react-server'
import config from '../config'
import createStore from '../../shared/createStore'
import getRoutes from '../../shared/routes'
import loadInitialState from '../loadInitialState'
import App from '../../shared/modules/app/containers/App'

export default createServerRenderer({
  createStore,                        // Function to create your redux store.

  getRoutes,                          // Function that returns your react-router routes.

  config,                             // Object or function that returns an object. 
                                      // Config gets added to your stores initial state.

  loadInitialState: (req, callback) => callback(null, state),                   
                                      // Function called on each request. 
                                      // You can load up any extra data to place in your store here. 
                                      // It'll be added to the initial state.
  
  omit: 'admin',                      // String or list of strings
                                      // These properties will be omitted from the stores initial state.

  alwaysFetch: App,                   // Component or list of components that will have their 
                                      // fetchData method called on each request.
})

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
11.0.02latest
1.0.0-alpha.70next

Version History

VersionDownloads (Last 7 Days)Published
11.0.02
10.1.40
10.0.00
9.0.00
9.0.0-rc.60
9.0.0-rc.40
9.0.0-rc.20
7.8.00
7.6.200
7.6.190
7.6.180
7.6.50
7.6.40
7.6.30
7.6.00
7.5.00
7.2.50
7.0.250
7.0.170
7.0.140
7.0.130
7.0.111
7.0.100
7.0.90
7.0.80
7.0.70
7.0.50
7.0.00
6.17.140
6.16.10
6.12.60
6.12.10
6.11.10
6.11.00
6.8.11
6.7.141
6.7.60
6.5.10
6.2.10
6.1.120
6.1.110
6.1.80
6.1.61
6.1.50
6.1.40
6.1.30
6.1.20
6.1.00
6.0.10
6.0.00
5.0.30
5.0.10
5.0.00
4.0.150
3.0.50
1.0.00
1.0.0-alpha.70
1.0.0-alpha.60
1.0.0-alpha.50
1.0.0-alpha.40
1.0.0-alpha.30
1.0.0-alpha.20
1.0.0-alpha.10
0.4.30
0.4.20
0.4.10
0.4.00
0.3.20
0.3.10
0.3.00
0.2.20
0.2.10
0.2.00
0.1.10
0.1.00

Package Sidebar

Install

npm i fl-react-server

Weekly Downloads

5

Version

11.0.0

License

MIT

Unpacked Size

29.4 kB

Total Files

14

Last publish

Collaborators

  • founderlab