@@ -2,13 +2,14 @@ import 'babel-polyfill';
22import React from 'react' ;
33import ReactDOM from 'react-dom' ;
44import { Provider } from 'react-redux' ;
5- import { BrowserRouter } from 'react-router-dom' ;
6- // import { browserHistory } from 'react-router';
7- // import { syncHistoryWithStore } from 'react-router-redux';
5+ import { ConnectedRouter } from 'react-router-redux' ;
86import { AppContainer } from 'react-hot-loader' ;
7+ import createHistory from 'history/createBrowserHistory' ;
98import configureStore from 'store' ;
109import App from 'containers/App' ;
1110
11+ const history = createHistory ( ) ;
12+
1213/* Images
1314 * This space is reserved for images that are required by server rendering,
1415 * e.g. the favicon and any other images that need to be in the base HTML file.
@@ -21,16 +22,15 @@ const rootElement = document.getElementById('app');
2122// Creates the Redux store based on the initial state passed down by the server
2223// rendering.
2324const initialState = window . __INITIAL_STATE__ ;
24- const store = configureStore ( initialState ) ;
25- // const history = syncHistoryWithStore(browserHistory, store);
25+ const store = configureStore ( initialState , history ) ;
2626
2727const render = ( Component ) => {
2828 ReactDOM . render (
2929 < Provider store = { store } >
3030 < AppContainer >
31- < BrowserRouter >
31+ < ConnectedRouter history = { history } >
3232 < Component />
33- </ BrowserRouter >
33+ </ ConnectedRouter >
3434 </ AppContainer >
3535 </ Provider > ,
3636 rootElement
0 commit comments