Skip to content

Instantly share code, notes, and snippets.

@vnctaing
Last active May 22, 2016 21:22
Show Gist options
  • Save vnctaing/9359f0224b7c004ced6396b8a1b022dd to your computer and use it in GitHub Desktop.
Save vnctaing/9359f0224b7c004ced6396b8a1b022dd to your computer and use it in GitHub Desktop.
Example of how to keep redux and react-router in sync
import { browserHistory } from 'react-router';
import DevTools from '../components/global/Devtools.jsx';
import { routerMiddleware, routerReducer } from 'react-router-redux';
const reactRouterMiddleware = routerMiddleware(browserHistory);
const enhancer = compose(
applyMiddleware(
thunkMiddleware,
loggerMiddleware,
reactRouterMiddleware
),
DevTools.instrument()
);
const store = createStore(
reducers,
enhancer
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment