It's a HoC that updates the reducer when using connected-react-router.
HoC implementation using How to navigate with Redux action with store.dispatch.
Using npm:
$ npm install --save connected-react-router-redux
Or yarn:
$ yarn add connected-react-router-redux
import { withRouterReducer } from 'connected-react-router-redux';
...
class AppComponent extends React.Component {
...
}
...
export default withRouterReducer(AppComponent);
...
import { withRouterReducer } from 'connected-react-router-redux';
...
class AppComponent extends React.Component {
...
}
...
export default withRouterReducer(
connect(
mapStateToProps,
mapDispatchToProps,
)(AppComponent)
);
import { withRouterReducer } from 'connected-react-router-redux';
...
class AppComponent extends React.Component<AppComponentProps, {}> {
...
}
...
export default withRouterReducer(AppComponent);
...
import { withRouterReducer } from 'connected-react-router-redux';
...
class AppComponent extends React.Component<AppComponentProps, {}> {
...
}
...
export default withRouterReducer(
connect<MapStateToProps, MapDispatchToProps, React.ComponentClass<AppComponentProps>>(
mapStateToProps,
mapDispatchToProps,
)(AppComponent)
);