Following are the fundamental building blocks to creating a route.
main.jsx into App.jsx and add it
to the imports array.
import { Fragment } from 'react';
import ReactDOM from 'react-dom/client'
import './index.scss'
import { BrowserRouter, Route, Routes } from 'react-router-dom';
ReactDOM.createRoot(document.getElementById('root')!).render(
<Fragment>
<BrowserRouter>
<Routes>
<Route path={`${import.meta.env.BASE_URL}`} element={<App />}>
{RouteData.map((idx) => (
<Route key={idx.id} path={idx.path} element={idx.element} />
))}
</Routes>
</BrowserRouter>
</HelmetProvider>
</Fragment>
);
Following are the fundamental building blocks to creating a new link.
path : (Root: src\pages\common\arreydata\Sidemenudata.jsx)
Ex:
{
title: "Dashboards", icon: 'bi-house', type: "sub", menusub: true, active: false, selected: false, dirchange: false, children:
[
{ path: `${import.meta.env.BASE_URL}maincomponent/dashboards/sales`, type: "link", active: false, selected: false, dirchange: false, title: "Sales", },
],
},