Snažím Reagovat Router V06, ale čelí problému, kde se snažím to pod tímto způsobem, ale každý tras a stránky jsou prázdné.
Kód:
// Main App Function
const App = () => {
return (
<Router>
<Fragment>
<Navbar />
<Routes>
<Route index strict path="/" element={<Landing />} />
**{/* Here I want to render paths from other function*/}**
<Route element={<AppRoutes />} />
</Routes>
</Fragment>
</Router>
);
};
export default App;
// In AppRoutes Function
const AppRoutes = () => (
<section className="container">
<Routes>
<Route strict path="login" element={<Login />} />
<Route strict path="register" element={<Register />} />
<Route path="*" element={<NotFound />} />
</Routes>
</section>
);
export default AppRoutes;