title: Create own react route class in typescript
body: <p>I found this (<a href="https://reacttraining.com/react-router/examples/auth-workflow" rel="noreferrer">reacttraining.com</a>) site, which explains react-router with some examples. But I am not be able to do this with a typescript class. What I want to do is extend the Route class to build my own one. Right now I want to implement it in typescript for authentication as in the following example from the site.</p>
  
  <pre><code>const PrivateRoute = ({ component, ...rest }) =&gt; (
    &lt;Route {...rest} render={props =&gt; (
      fakeAuth.isAuthenticated ? (
        React.createElement(component, props)
      ) : (
        &lt;Redirect to={{
          pathname: '/login',
          state: { from: props.location }
        }}/&gt;
      )
    )}/&gt;
  )
  </code></pre>
  
  <p>I searched a lot, but couldn't find a site that explains the function to implement and which typed properties to call to nested routes. An ES6 class will be also helpful, thank you. </p>