I have the following code from the V5 Documentation:
<Route exact path="/">
{loggedIn ? <Redirect to="/dashboard" /> : <PublicHomePage />}
</Route>
I know that I have Navigate
instead of Redirect
in V6, but Navigate
seems not to work the exact same way:
<Route></Route>
{loggedIn ? <Navigate to="/dashboard" /> : <PublicHomePage />}
</Route>
Uncaught Error: [Navigate] is not a <Route> component.
How can I archieve this with React Router V6?