diff --git a/package.json b/package.json index 8c06493..b3f69b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-router-redux-bind", - "version": "0.2.0", + "version": "0.2.1", "description": "Redux bindings for React Router Next v4", "main": "index.js", "module": "src/index.js", diff --git a/src/middleware.js b/src/middleware.js index 43f4710..21b30e2 100644 --- a/src/middleware.js +++ b/src/middleware.js @@ -2,8 +2,8 @@ import { ROUTER_ACTION } from './actions' const routerMiddleware = history => () => next => action => { - const { type, payload: { method, args } } = action - if (type !== ROUTER_ACTION) return next(action) + if (action.type !== ROUTER_ACTION) return next(action) + const { payload: { method, args } } = action history[method](...args) }