score:8

Accepted answer

Try this

createStore(
  combineReducers({
    ...reducers,
    routing: routerReducer
  }), 
  applyMiddleware(thunk)
)

Syntax:

createStore(reducer, [preloadedState], [enhancer])

Enhancer must be the last parameter for createStore()

Read more from here

score:4

better solution:

app.js:

    import {createStore, applyMiddleware, compose} from 'redux';
    import {browserHistory, Router, Route, IndexRoute} from 'react-router';
    import {syncHistoryWithStore, routerMiddleware} from 'react-router-redux';
    import {reducers} from './reducers';

   const initial_state = {};

    let middleware = applyMiddleware(routerMiddleware(browserHistory));
        if (process.env.NODE_ENV !== 'production') {
            middleware = compose(middleware, window.devToolsExtension && window.devToolsExtension());
        }
        const store   = createStore(reducers, initial_state, middleware);
        const history = syncHistoryWithStore(browserHistory, store);

reducers:

import {combineReducers} from 'redux';
import {routerReducer} from 'react-router-redux';
import users from './users';

export const reducers = combineReducers({
    routing:routerReducer,
    users: users
});

Related Query

More Query from same tag