I have route <Route path="login" element={} />, how can I use this route in all routes: /main:page, /main/post:id. For example, when I visit /main/post:id, I want to see the PostCurrent component and the SignIn component on the same page. I guess I'm explaining my problem correctly. I'm using v6 of react-router.
<Routes>
<Route path="/main" element={<Main />}>
<Route path=":page" element={<><PostList /><Pagination /></>} />
<Route path="post/:id" element={<PostCurrent />} />
<Route path="login" element={<SignIn />} />
</Route>
<Route element={<ProtectedRoute />}>
<Route path="/dashboard" element={<Dashboard />}>
<Route path="post-form" element={<PostForm />} />
<Route path="post-list" element={<PostListDashBoard />} />
</Route>
</Route>
<Route path="*" element={<Navigate to="/main/0" replace />} />
</Routes>