react-router-query-middleware
✅ A solution for this
🌴 It adds query object into router reducer when using: React Router v4 ➕ connected-react-router
Installation
$ npm install --save react-router-query-middleware
Simple usage
Add the middleware after the routerMiddleware provided from connected-react-router
...;;... const middlewares = ... thunk ... // Add other middlewares here ; ;...
- If you use deprecated react-router-redux then install v2.0.2
Advanced usage
You can configure the action name that triggers location change or the path of location object in triggered action
...;...
Options
opt | default | type | description |
---|---|---|---|
actionName | @@router/LOCATION_CHANGE | string | Action name that triggers location change |
actionLocationPath | payload.location | string | Path of location object in triggered action |
License
MIT