Skip to content

Commit 4d5d2d5

Browse files
committed
Merge pull request reduxjs#638 from eiriklv/master
Fix universal rendering example (configureStore vs. createStore)
2 parents 079fd96 + 723e474 commit 4d5d2d5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

examples/universal/client.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import 'babel-core/polyfill';
22
import React from 'react';
3-
import { createStore } from 'redux';
3+
import configureStore from './store/configureStore';
44
import { Provider } from 'react-redux';
55
import App from './containers/App';
6-
import counterApp from './reducers';
76

87
const initialState = window.__INITIAL_STATE__;
98

10-
const store = createStore(counterApp, initialState);
9+
const store = configureStore(initialState);
1110

1211
const rootElement = document.getElementById('app');
1312

examples/universal/server.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import path from 'path';
22
import Express from 'express';
33
import qs from 'qs';
44
import React from 'react';
5-
import { createStore } from 'redux';
5+
import configureStore from './store/configureStore';
66
import { Provider } from 'react-redux';
7-
import counterApp from './reducers';
87
import App from './containers/App';
98
import { fetchCounter } from './api/counter';
109

@@ -30,7 +29,7 @@ function handleRender(req, res) {
3029
let initialState = { counter };
3130

3231
// Create a new Redux store instance
33-
const store = createStore(counterApp, initialState);
32+
const store = configureStore(initialState);
3433

3534
// Render the component to a string
3635
const html = React.renderToString(

0 commit comments

Comments
 (0)