title: Binding element 'Component' implicitly has an 'any' type.ts
body: <p>Newbie here. I have problems with the following code. I want to define a protected "Dashboard" page, as follows, but is giving me this binding error:</p>
  
  <pre><code>Binding element 'Component' implicitly has an 'any' type.ts(7031)
  
  
  import * as React from "react";
  import { Route, Router, Redirect } from "react-router-dom";
  import Dashboard from "../features/dashboard";
  import LoginContainer from "../features/login/containers/LoginContainer";
  import SignUpContainer from "../features/signup/containers/SignUpContainer";
  import { createBrowserHistory } from "history";
  
  const history = createBrowserHistory();
  
  export default () =&gt; (
    &lt;Router history={history}&gt;
      &lt;Route path="/" component={LoginContainer} /&gt;
      &lt;Route path="/login" component={LoginContainer} /&gt;
      &lt;Route path="/register" component={SignUpContainer} /&gt;
  
      &lt;PrivateRoute path="/dashboard" component={Dashboard} /&gt;
    &lt;/Router&gt;
  );
  
  function PrivateRoute({ component: Component, ...rest }) {
    return (
      &lt;Route
        {...rest}
        render={props =&gt;
          localStorage.getItem("MyStoredUser") ? (
            &lt;Component {...props} /&gt;
          ) : (
            &lt;Redirect
              to={{
                pathname: "/login"
              }}
            /&gt;
          )
        }
      /&gt;
    );
  }
  </code></pre>
  
  <p>Basically I am using the same code as it is here:<a href="https://tylermcginnis.com/react-router-protected-routes-authentication/" rel="noreferrer">Protected routes and authentication with React Router v4</a>
  and
  <a href="https://reacttraining.com/react-router/web/example/auth-workflow" rel="noreferrer">eact Router - Redirects</a> </p>
  
  <p>What am I doing wrong?</p>
  
  <p><a href="https://i.stack.imgur.com/hgFcj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hgFcj.png" alt="Error Img"></a></p>