From 7750a4178a0846f4e888c696af3fbfa7f82d7cf3 Mon Sep 17 00:00:00 2001 From: Gustaf Dalemar Date: Fri, 6 May 2016 11:16:09 +0200 Subject: [PATCH] Fixes so React Router Redux is used on the server and in production --- .../app/shared/flux/create-store.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/roc-package-web-app-react/app/shared/flux/create-store.js b/packages/roc-package-web-app-react/app/shared/flux/create-store.js index a1489dd..1b5ad9d 100755 --- a/packages/roc-package-web-app-react/app/shared/flux/create-store.js +++ b/packages/roc-package-web-app-react/app/shared/flux/create-store.js @@ -20,6 +20,9 @@ export default function createReduxStore(reducers, ...middlewares) { (history, initialState) => { let finalCreateStore; + // Add the react-router-redux middleware + middlewares.push(routerMiddleware(history)); + if (__DEV__ && __WEB__) { const { persistState } = require('redux-devtools'); const createLogger = require('redux-logger'); @@ -32,8 +35,6 @@ export default function createReduxStore(reducers, ...middlewares) { const debugMiddlewares = [logger]; - // Add the react-router-redux middleware - middlewares.push(routerMiddleware(history)); const devTools = window.devToolsExtension ? window.devToolsExtension() // TODO Enable maxAge support here. Will require a fix for validations in roc