title: Converting React function component to class component issue
body: <p>I have the following react functional component to help support authentication required routes with react-router.</p>
  
  <pre><code>const PrivateRoute = ({ component: Component, ...rest }) =&gt; (
    &lt;Route {...rest} render={props =&gt; (
      isAuthenticated() ? ( 
          &lt;Component {...props}/&gt;
      ) : (
          &lt;Redirect to={{
              pathname: '/login', 
              state: {from: props.location }
          }}/&gt;
      )
    )}/&gt;
  )
  </code></pre>
  
  <p>I need to convert this from a functional component to a class component so I can take advantage of the componentDidMount method of React.Component.  Unfortunately I'm having trouble figuring out how to migrate this.  If I take it as is I need to replicate the Component and ...rest parameters, but I'm not sure how to do that. I think I can get the Component parameter with this.props.component, but I'm not sure how to pull ...rest.  I'm new to JSX and ES6 so any help or guidance would be much appreciated. </p>