We are currently using connected-react-router which maintains up-to-date router information in the Redux store so getting access to this information is the same as for any other data in Redux. This eliminates the need to use withRouter to get access to this data.
All data is currently available under the router key in the Redux store, Ex:
import React from 'react';
import { connect } from 'react-redux';
export const MyComponent = ({ currentPath }) => <div>{currentPath}</div>;
const mapStateToProps = ({ router }) => ({
currentPath: router.location.pathname
});
export default connect(mapStateToProps)(MyComponent);