Skip to content

Commit

Permalink
Upgraded react-router-redux to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin committed Mar 3, 2016
1 parent 4ee75e5 commit 39347ea
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { Router, hashHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import routes from './routes';
import configureStore from './store/configureStore';
import './app.global.css';

const store = configureStore();
const history = syncHistoryWithStore(hashHistory, store);

render(
<Provider store={store}>
<Router history={hashHistory}>
{routes}
</Router>
<Router history={history} routes={routes} />
</Provider>,
document.getElementById('root')
);
Expand Down
2 changes: 1 addition & 1 deletion app/reducers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { combineReducers } from 'redux';
import { routeReducer as routing } from 'react-router-redux';
import { routerReducer as routing } from 'react-router-redux';
import counter from './counter';

const rootReducer = combineReducers({
Expand Down
7 changes: 3 additions & 4 deletions app/store/configureStore.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { createStore, applyMiddleware, compose } from 'redux';
import { persistState } from 'redux-devtools';
import thunk from 'redux-thunk';
import { hashHistory } from 'react-router';
import { syncHistory } from 'react-router-redux';
import { routerMiddleware } from 'react-router-redux';
import rootReducer from '../reducers';
import DevTools from '../containers/DevTools';

const router = syncHistory(hashHistory);
const router = routerMiddleware(hashHistory);

const enhancer = compose(
applyMiddleware(thunk, router),
DevTools.instrument(),
Expand All @@ -20,8 +21,6 @@ const enhancer = compose(
export default function configureStore(initialState) {
const store = createStore(rootReducer, initialState, enhancer);

router.listenForReplays(store);

if (module.hot) {
module.hot.accept('../reducers', () =>
store.replaceReducer(require('../reducers'))
Expand Down
5 changes: 3 additions & 2 deletions app/store/configureStore.production.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { hashHistory } from 'react-router';
import { syncHistory } from 'react-router-redux';
import { routerMiddleware } from 'react-router-redux';
import rootReducer from '../reducers';

const router = syncHistory(hashHistory);
const router = routerMiddleware(hashHistory);

const enhancer = applyMiddleware(thunk, router);

export default function configureStore(initialState) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"react-dom": "^0.14.2",
"react-redux": "^4.0.5",
"react-router": "^2.0.0",
"react-router-redux": "^3.0.0",
"react-router-redux": "^4.0.0",
"redux": "^3.2.1",
"redux-promise": "^0.5.0",
"redux-thunk": "^1.0.2"
Expand Down

0 comments on commit 39347ea

Please sign in to comment.