Routing
Page and URL routing
Berry routing system is based on react-router and its package react-router-dom, it's also using code splitting for better performance.
Configure route
Open ...\src\routes\index.js You will find the below example code. In the below code we have shown four different routes. <MainRoutes/> is the main layout routing you see after login.
...
...
// ===============|| ROUTING RENDER ||=================== //
export default function ThemeRoutes() {
return useRoutes([
{ path: '/', element: <PagesLanding /> },
AuthenticationRoutes,
LoginRoutes,
MainRoutes]);
}...
...
// ===============|| ROUTING RENDER ||=================== //
export default function ThemeRoutes() {
return useRoutes([
{ path: '/', element: <PagesLanding /> },
AuthenticationRoutes,
LoginRoutes,
MainRoutes]);
}Add New menu/route in the main layout
To add one more menu item in <MainRoutes />, update the following file at the same location ...\src\routes\MainRoutes.js
Any route added in <MainLayout> will automatically go through <AuthGuard>
Last updated
Was this helpful?