title: Type '(props: RouteProps) => JSX.Element' is not assignable to type 'PropsWithChildren<RouteProps>'
body: <p>I am using typescript with react I wanted to render a component but getting typescript error</p>
  <p>Type '(props: RouteProps) =&gt; JSX.Element' is not assignable to type 'PropsWithChildren'.<br />
  Property 'component' is missing in type '(props: RouteProps) =&gt; JSX.Element' but required in type 'RouteProps'.</p>
  <pre><code> import React, { ReactNode, PropsWithChildren } from &quot;react&quot;;
   import { Route, Redirect } from &quot;react-router&quot;;
   
    export interface RouteProps {
       component: FunctionComponent;
     }
  
  
   interface PrivateRoutesProp {
     // component: PropsWithChildren&lt;RouteProps&gt; // not works  
       // also having &quot;noImplicitAny&quot;: true, [this was mandatory]
     component: PropsWithChildren&lt;???&gt;; //what i have to use here,object is not working
     exact: boolean;
    path: string;
   }
  
  const PrivateRoute = ({ component: Component, ...rest }: PrivateRoutesProp) =&gt; (
    &lt;Route
     {...rest}
    render={(props) =&gt; (isLoggedIn ? &lt;Component {...props} /&gt; : &lt;Redirect to=&quot;/&quot; /&gt;)}
    /&gt;
    );
  
   export default PrivateRoute;
  </code></pre>
  <p>can anyone help me out of this</p>