From 3a1ed66c5e730c6a805f505c4e02accce8881981 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Thu, 26 Oct 2017 14:48:42 +0300 Subject: [PATCH] Fix configureStore params --- server/dataLoader.js | 2 +- src/app.js | 4 ++-- src/app.test.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/dataLoader.js b/server/dataLoader.js index 6f5e6dac..fa658098 100644 --- a/server/dataLoader.js +++ b/server/dataLoader.js @@ -6,7 +6,7 @@ exports.loadData = function(requestUrl, sdk) { const { pathname, query } = url.parse(requestUrl); const matchedRoutes = matchPathname(pathname, routeConfiguration()); - const store = configureStore(sdk); + const store = configureStore({}, sdk); const dataLoadingCalls = matchedRoutes.reduce((calls, match) => { const { route, params } = match; diff --git a/src/app.js b/src/app.js index bf56f000..a77e2b64 100644 --- a/src/app.js +++ b/src/app.js @@ -56,10 +56,10 @@ ServerApp.propTypes = { url: string.isRequired, context: any.isRequired, store: * - {Object} head: Application head metadata from react-helmet */ export const renderApp = (url, serverContext, preloadedState) => { - // Pass `null` as the SDK instance since we're only rendering the + // Don't pass an SDK instance since we're only rendering the // component tree with the preloaded store state and components // shouldn't do any SDK calls in the (server) rendering lifecycle. - const store = configureStore(null, preloadedState); + const store = configureStore(preloadedState); const body = ReactDOMServer.renderToString( diff --git a/src/app.test.js b/src/app.test.js index 24d1ef19..e4e063ed 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -7,7 +7,7 @@ import { ClientApp, ServerApp } from './app'; import configureStore from './store'; const render = (url, context) => { - const store = configureStore({}); + const store = configureStore(); const body = ReactDOMServer.renderToString( ); @@ -18,7 +18,7 @@ const render = (url, context) => { describe('Application', () => { it('renders in the client without crashing', () => { window.google = { maps: {} }; - const store = configureStore({}); + const store = configureStore(); const div = document.createElement('div'); ReactDOM.render(, div); delete window.google;