// https://github.com/supasate/connected-react-router // configureStore.js import { createBrowserHistory } from 'history' import { applyMiddleware, compose, createStore } from 'redux' import { routerMiddleware } from 'connected-react-router' import createRootReducer from './reducers' import thunk from 'redux-thunk'; export const history = createBrowserHistory() export default function configureStore(preloadedState) { const store = createStore( createRootReducer(history), // root reducer with router state preloadedState, compose( applyMiddleware( routerMiddleware(history), // for dispatching history actions thunk, // ... other middlewares ... ), ), ) return store }