title: Error: [PrivateRoute] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>
body: <p>I'm using React Router v6 and am creating private routes for my application.</p>
  <p>In file <em>PrivateRoute.js</em>, I've the code</p>
  <pre><code>import React from 'react';
  import {Route,Navigate} from &quot;react-router-dom&quot;;
  import {isauth}  from 'auth'
  
  function PrivateRoute({ element, path }) {
    const authed = isauth() // isauth() returns true or false based on localStorage
    const ele = authed === true ? element : &lt;Navigate to=&quot;/Home&quot;  /&gt;;
    return &lt;Route path={path} element={ele} /&gt;;
  }
  
  export default PrivateRoute
  </code></pre>
  <p>And in file <em>route.js</em> I've written as:</p>
  <pre><code> ...
  &lt;PrivateRoute exact path=&quot;/&quot; element={&lt;Dashboard/&gt;}/&gt;
  &lt;Route exact path=&quot;/home&quot; element={&lt;Home/&gt;}/&gt;
  </code></pre>
  <p>I've gone through the same example <em><a href="https://stackblitz.com/github/remix-run/react-router/tree/main/examples/auth?file=src/App.tsx" rel="noreferrer">React-router Auth Example - StackBlitz, file App.tsx</a></em></p>
  <p>Is there something I'm missing?</p>