react-router-redux, specifically version 4.0.8, provided "ruthlessly simple bindings" to keep React Router (versions 2.x and 3.x) and Redux in sync. Its primary purpose was to store React Router's location state within the Redux store, enabling features like time-travel debugging with Redux DevTools. It offered middleware to dispatch navigation actions and a reducer to manage router state. The library itself was noted as 'beta software' in its README. While `react-router-redux` version 5.x was intended for React Router 4.x, the repository for this project has been archived since October 26, 2018, rendering it abandoned. Modern React applications typically use `@reduxjs/toolkit` and `react-router-dom` directly, often with `connected-react-router` (a spiritual successor) or `redux-first-history` for similar state synchronization needs, rather than this deprecated package.
npm install react-router-reduxVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up `react-router-redux` with `redux` and `react-router` (v4.x is assumed for `ConnectedRouter` from the README, despite the package version being 4.0.8, implying a common usage pattern at the time of the README update). It shows combining reducers, applying the router middleware, and using `ConnectedRouter` to synchronize browser history with the Redux store.
Review the 4.0.0 release notes and adjust your application to explicitly import and use `routerMiddleware` and `push` if you still require Redux-driven navigation. For simpler cases, directly using React Router's history objects is recommended.
For new projects or existing applications on modern React Router versions (v5+), consider alternatives like `connected-react-router` (a community-maintained successor to `react-router-redux` for React Router v4/v5) or `redux-first-history` (supporting React Router v5/v6 and other routers). For applications not needing Redux time-travel for routing, `react-router-dom` and `react-redux` can be used independently.
Ensure compatibility between your `react-router-redux` version and `react-router` version. If using `react-router` v4 or later, you should generally use `connected-react-router` or `redux-first-history`, not `react-router-redux` v4.x.
Proceed with caution. Given its abandoned status, expect no further fixes for bugs or security vulnerabilities. Thorough testing is recommended if using in legacy systems.
Always rely on the props passed by React Router to your components, as these are updated only after React Router has processed all asynchronous code and updated the component tree.
Upgrade to `react-router-redux` version 4.0.2 or later to resolve this issue.
Ensure you are using at least `react-router-redux` version 4.0.0-rc.2 or later, which included a fix for this bug.
For `react-router-redux` v4.x, ensure you have `history` installed (e.g., `npm install --save history`). The usage example imports `createHistory from 'history/createBrowserHistory'`, which is for `history` v4.x. If using an older `history` version, `createBrowserHistory` might be a direct export from 'history'.