I am trying to organize the routes in `react-router-dom v6. And here is my flow:
root AppComponent
function AppComponent() {
return <AppRoute />;
}
AppRoute.js (base routes)
const AppRoute = () => {
return (
<>
<GuestRoute path="/login" component={Login} />
</>
);
};
GuestRoute
const GuestRoute = ({ component: Component, ...rest }) => {
return (
<GuestLayout>
<Routes>
<Route {...rest} element={<Component />} />
</Routes>
</GuestLayout>
);
};
GuestLayout
const GuestLayout = ({ children, ...rest }) => {
return (
<div>
{children}
</div>
);
};
But, when I go to /login, it is not breaking the page, but it is still showing a warning of No routes matched location "/login". I am using react-router-dom v6