At the time of writing this book, the latest version of connected-react-router was 4.5. We always suggest updating your library with the latest version (https://github.com/supasate/connected-react-router). As stated on the official documentation site, the library provides Redux binding for react-router version 4.
Let's get started, as follows:
yarn add connected-react-router --exact
The usage of connected-react-router is pretty simple. Instead of using BrowserRouter from react-router-dom, we use ConnectedRouter from connected-react-router.
Our app.js will look as follows:
import { ConnectedRouter } from "connected-react-router/immutable";
const render = () => {
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<App />
</ConnectedRouter>
</Provider>...