Fix configureStore params

This commit is contained in:
Kimmo Puputti 2017-10-26 14:48:42 +03:00
parent d0b728bfd6
commit 3a1ed66c5e
3 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@ exports.loadData = function(requestUrl, sdk) {
const { pathname, query } = url.parse(requestUrl); const { pathname, query } = url.parse(requestUrl);
const matchedRoutes = matchPathname(pathname, routeConfiguration()); const matchedRoutes = matchPathname(pathname, routeConfiguration());
const store = configureStore(sdk); const store = configureStore({}, sdk);
const dataLoadingCalls = matchedRoutes.reduce((calls, match) => { const dataLoadingCalls = matchedRoutes.reduce((calls, match) => {
const { route, params } = match; const { route, params } = match;

View file

@ -56,10 +56,10 @@ ServerApp.propTypes = { url: string.isRequired, context: any.isRequired, store:
* - {Object} head: Application head metadata from react-helmet * - {Object} head: Application head metadata from react-helmet
*/ */
export const renderApp = (url, serverContext, preloadedState) => { 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 // component tree with the preloaded store state and components
// shouldn't do any SDK calls in the (server) rendering lifecycle. // shouldn't do any SDK calls in the (server) rendering lifecycle.
const store = configureStore(null, preloadedState); const store = configureStore(preloadedState);
const body = ReactDOMServer.renderToString( const body = ReactDOMServer.renderToString(
<ServerApp url={url} context={serverContext} store={store} /> <ServerApp url={url} context={serverContext} store={store} />

View file

@ -7,7 +7,7 @@ import { ClientApp, ServerApp } from './app';
import configureStore from './store'; import configureStore from './store';
const render = (url, context) => { const render = (url, context) => {
const store = configureStore({}); const store = configureStore();
const body = ReactDOMServer.renderToString( const body = ReactDOMServer.renderToString(
<ServerApp url={url} context={context} store={store} /> <ServerApp url={url} context={context} store={store} />
); );
@ -18,7 +18,7 @@ const render = (url, context) => {
describe('Application', () => { describe('Application', () => {
it('renders in the client without crashing', () => { it('renders in the client without crashing', () => {
window.google = { maps: {} }; window.google = { maps: {} };
const store = configureStore({}); const store = configureStore();
const div = document.createElement('div'); const div = document.createElement('div');
ReactDOM.render(<ClientApp store={store} />, div); ReactDOM.render(<ClientApp store={store} />, div);
delete window.google; delete window.google;