title: React Router 4. Get active route
body: <p>I have code</p>
  
  <p>router.js</p>
  
  <pre><code>import React from 'react';
  import {render} from "react-dom";
  import history from './history';
  import {Router, Route} from 'react-router'
  
  import Main from "./main/component";
  import Profile from "./profile/component";
  import TextStatus from "./textstatus/component";
  import ContactList from "./contactlist/component";
  
  render((
    &lt;Router history={history}&gt;
      &lt;Main&gt;
        &lt;Route
          path="/:user_name"
          component={Profile}
          component_id="Profile"
        /&gt;
        &lt;Route
          path="/:user_name/status"
          component={TextStatus}
          component_id="TextStatus"
        /&gt;
        &lt;Route
          path="/:user_name/contacts"
          component={ContactList}
          component_id="ContactList"
        /&gt;
      &lt;/Main&gt;
    &lt;/Router&gt;
  
  ), document.getElementById("main"));
  </code></pre>
  
  <p>history.js</p>
  
  <pre><code>import createBrowserHistory from 'history/createBrowserHistory'
  const history = createBrowserHistory();
  export default history;
  </code></pre>
  
  <p>main/component.js //main layout</p>
  
  <pre><code>import React from 'react';
  class Main extends React.Component {
     render() {
        return (this.props.children)
     }
  }
  </code></pre>
  
  <p>How can I get the current route (component_id) in Main component?</p>
  
  <p>In react router 1.0.3 I did this: <code>this.props.children.props.route.component_id</code></p>
  
  <p>Thank you for attention!</p>