{"size": 388, "ext": "js", "max_stars_repo_path": "master/react-router-xs-master/react-router-xs-master/src/withRouter.js", "max_stars_repo_name": "AlexRogalskiy/DevArtifacts", "max_stars_repo_stars_event_min_datetime": "2018-09-07T15:35:24.000Z", "max_stars_repo_stars_event_max_datetime": "2019-03-27T09:48:12.000Z", "max_issues_repo_path": "master/react-router-xs-master/react-router-xs-master/src/withRouter.js", "max_issues_repo_name": "AlexRogalskiy/DevArtifacts", "max_issues_repo_issues_event_min_datetime": "2020-03-04T21:51:56.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T20:59:11.000Z", "max_forks_repo_path": "master/react-router-xs-master/react-router-xs-master/src/withRouter.js", "max_forks_repo_name": "AlexRogalskiy/DevArtifacts", "max_forks_repo_forks_event_min_datetime": "2019-06-18T19:57:17.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-06T03:55:08.000Z"}
{"max_stars_count": 4, "max_issues_count": 371, "max_forks_count": 3, "avg_line_length": 25.8666666667, "max_line_length": 79, "alphanum_fraction": 0.5051546392}
import React from 'react';

import { Consumer } from './Router';

export default function withRouter (Component) {
    return class WithRouter extends React.PureComponent {
        render = () => {
            return (
                <Consumer>
                    {context => <Component {...this.props} router={context} />}
                </Consumer>
            );
        };
    };
}