Protium
Protium is a micro framework for building universal React/Redux apps.
Bundles react
, react-router
, and redux
into a nice little package, takes care of routing and store/reducer setup for you (more examples forthcoming).
Uses react-helmet for <head>
management.
import {Helmet} from 'protium'
, and include that component within any of your views.
Example
webpack.config.js
var DevTools = default var devtools = __dirname // sets webpack context for your app moduleexports = devtools // points to exported application devtools // points to client entrypoint
app.js
const router = { // use onEnter props to validate routes based on app state // Can also return a promise here, for async route definition return <Route path="/" component=Root> <IndexRoute component=Comp /> <Route path="/a" component=Comp /> <Route path="/b" component=Comp /> <Route path="/c" component=Comp /> <Route path="*" component=NotFoundComp notFound=true /> // signals 404 on server </Route> }
client.js
// client.js (short and sweet!) app
// server.js const server = serverserver