title: style react router active link
body: <p>I am using react router 3 for routing. I have tried to develop a generic tab but I have no idea on how should i check if the link is active or not so I can pass it the classname as 'selected'.</p>
  
  <p>Here is my code </p>
  
  <pre><code>const FunctionalTab = ({ items, handleTabKey, ...props }) =&gt; {
    console.log("props", props.router);
    return (
      &lt;x-tab&gt;
        &lt;x-tab-item&gt;
          {(items || []).map((item, idx) =&gt; (
            &lt;Link key={idx} onClick={() =&gt; handleTabKey(item)}&gt;
              {" "}
              {item.name} &lt;br /&gt;
            &lt;/Link&gt;
          ))}
          &lt;br /&gt;
        &lt;/x-tab-item&gt;
      &lt;/x-tab&gt;
    );
  };
  
  const enhance = compose(
    // handler responsible for changing the tab
    withHandlers({
      handleTabKey: props =&gt; route =&gt;
        props.router.push(`/commissions/${props.params.id}/details/${route.to}`) // this to be generic 
    })
  );
  
  export default withRouter(enhance(FunctionalTab));
  </code></pre>