title: What type should I declare for object rest props?
body: <p>Here is an example from react-router for how to add a component for protected routes:</p>
  
  <pre><code>function PrivateRoute({ component: Component, ...rest }) {
    return (
      &lt;Route
        {...rest}
        render={props =&gt;
          fakeAuth.isAuthenticated ? (
            &lt;Component {...props} /&gt;
          ) : (
            &lt;Redirect
              to={{
                pathname: "/login",
                state: { from: props.location }
              }}
            /&gt;
          )
        }
      /&gt;
    );
  }
  </code></pre>
  
  <p><a href="https://reacttraining.com/react-router/web/example/auth-workflow" rel="noreferrer">https://reacttraining.com/react-router/web/example/auth-workflow</a></p>
  
  <p>I have tried to implement this functionality in my Typescript project, using the example above as inspiration.</p>
  
  <pre><code>import * as React from 'react';
  import {
      Route,
      Redirect,
  } from 'react-router-dom';
  
  interface PrivateRouteProps {
      component: React.Component; // passed as prop
      isSignedIn: boolean; // injected as prop by redux
      location: Location;
  }
  
  const PrivateRoute = (props: PrivateRouteProps) =&gt; {
      const { component: Component, isSignedIn, location } = props;
  
      return (
          &lt;Route
              {...rest}
              render={(routeProps) =&gt;
                  isSignedIn ? (
                      &lt;Component {...routeProps} /&gt;
                  ) : (
                          &lt;Redirect
                              to={{
                                  pathname: '/signin',
                                  state: { from: location }
                              }}
                          /&gt;
                      )
              }
          /&gt;
      );
  };
  
  export default PrivateRoute;
  </code></pre>
  
  <p>I get the following errors</p>
  
  <pre><code>[ts] Cannot find name 'rest'.
  any
  
  [ts] JSX element type 'Component' does not have any construct or call signatures.
  const Component: React.Component&lt;{}, {}, any&gt;
  </code></pre>