
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@bentatum/react-router-redux
Advanced tools
Keep React Router in sync with Redux
Using npm:
npm install --save react-router-redux
A UMD build is also available on unpkg:
<script src="https://unpkg.com/react-router-redux/umd/react-router-redux.min.js"></script>
Let's take a look at a simple example.
import React from 'react'
import ReactDOM from 'react-dom'
import { createStore, combineReducers } from 'redux'
import { Provider } from 'react-redux'
import { Match } from 'react-router'
import { ConnectedRouter, routerReducer } from 'react-router-redux'
import reducers from '<project-path>/reducers'
import App from '<project-path>/components/App'
// Add the reducer to your store on the `router` key
const store = createStore(
combineReducers({
...reducers,
router: routerReducer
})
)
ReactDOM.render(
<Provider store={store}>
{ /* Use the ConnectedRouter inside of Provider */ }
<ConnectedRouter>
<Match pattern="/" component={App}/>
</ConnectedRouter>
</Provider>,
document.getElementById('root')
)
The location will automatically be synced with state.router.location. You can also access the last action type with state.router.action.
dispatch(push('/foo')))FAQs
Synchronize React Router with your Redux store
We found that @bentatum/react-router-redux demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.