내가 노력하고 반응 라우터 V06 지만,문제에 직면한 어 려고 노력했습니다 이 아래 방법이지만 모든 경로 및 페이 비어 있습니다.
코드:
// 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;