Routing
Page and URL routing
Mantis routing system is based on react-router and its package react-router-dom, it's also using code splitting for better performance.
This documentation page elaborates on routing using react-router. Given that Next.js employs the 'APP' directory, no supplementary documentation is required in this regard. You can refer to Next.js' 'APP' directory routing here: Next.js Documentation.
For further insights into Mantis Next.js' directory structure, please refer to: Next.js Folder Structure.
Configure route
Open ...\src\routes\index.jsx
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.
How can I add a new page with a menu item?
You can use the below explanation to add/remove menu routes and their menu items.
Add a 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.jsx
Any route added in <MainLayout>
will automatically go through <AuthGuard>
Further, same menu needed to add in respective Json as well here: src/menu-items
Last updated