title: Protected route with react router v6
body: <p>What is correct way to write a ProtectedRoute with new version 6 of react-router?
  I wrote this one, but it's not a route</p>
  
  <pre><code>const PrivateRoute = ({ component: Component, ...props }) =&gt; {   
    if (!Component) return null;
  
    return props.isAuthenticated
      ? &lt;Component /&gt;
      : &lt;Navigate to={props.redirectLink} /&gt; }
  
  export default PrivateRoute;
  </code></pre>