I want to know how can I implement multiple route with single container or layout in react-router-dom v6
Here is my code so far:
<Routes>
<Route
path="/dashboard"
element={
<AdminLayout>
<DashboardScreen />
</AdminLayout>
}
/>
<Route
path="/guides"
element={
<AdminLayout>
<GuidesScreen />
</AdminLayout>
}
/>
<Route
path="/post"
element={
<AdminLayout>
<PostScreen />
</AdminLayout>
}
/>
</Routes>
But it's not working, What Am I missing here?
Thanks!
Code Update:
<Routes>
<LoginLayout>
<Route path="/" element={<SignInForm />} />
<Route path="/signin" element={<SignInForm />} />
<Route path="/newpassword" element={<NewPassword />} />
<Route path="/phoneverification" element={<PhoneVerification />} />
<Route path="/continuewithphone" element={<ContWithPhone />} />
<Route path="/resetpassword" element={<ResetPassword />} />
<Route
path="/confirm-resetpassword"
element={<ConfirmResetPassword />}
/>
</LoginLayout>
</Routes>
<Routes>
<AdminLayout>
//Routes here
</AdminLayout>
</Routes>
Sample Console warnings:
