Following are the fundamental building blocks to creating a route.
Import the main.tsx
into App.tsx
and add it
to the imports array.
import ReactDOM from 'react-dom/client'
import { Routedata } from "./components/common/routingdata";
import App from "./layouts/App";
import './index.scss'
import { HelmetProvider } from 'react-helmet-async';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { Fragment } from 'react';
import Login from './container/authentication/login/login';
import Authenticationlayout from './layouts/authentication-layout';
import Register from './container/authentication/register/register';
import Forgotpassword from './container/authentication/forgotpassword/forgotpassword';
import Lockscreen from './container/authentication/lockscreen/lockscreen';
import Underconstruction from './container/authentication/underconstruction/underconstruction';
import Error400 from './container/authentication/errorpages/error400/error400';
import Error401 from './container/authentication/errorpages/error401/error401';
import Error403 from './container/authentication/errorpages/error403/error403';
import Error404 from './container/authentication/errorpages/error404/error404';
import Error500 from './container/authentication/errorpages/error500/error500';
import Error503 from './container/authentication/errorpages/error503/error503';
import Firebasesignin from './firebase/Firebasesignin';
import Firebasesignup from './firebase/Firebasesignup';
import Firebasereset from './firebase/Firebasereset';
ReactDOM.createRoot(document.getElementById('root')!).render(
<
Fragment>
<
HelmetProvider>
<
BrowserRouter>
<
Routes>
//firebase authentication
<
Route path={`${import.meta.env.BASE_URL}`} element={ }>
<
Route index element={ } />
<
Route path={`${import.meta.env.BASE_URL}firebase/firebasesignin`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}firebase/firebasesignup`} element={ } />
//<
Route path={`${import.meta.env.BASE_URL}firebase/firebasereset`} element={ } />
<
Route path='*' element={ } />
<
Route path={`authentication/login`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/register`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/forgotpassword`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/lockscreen`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/underconstruction`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/errorpages/error400`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/errorpages/error401`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/errorpages/error403`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/errorpages/error404`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/errorpages/error500`} element={ } />
<
Route path={`${import.meta.env.BASE_URL}authentication/errorpages/error503`} element={ } />
<
/Route>
//main route
<
Route path={`${import.meta.env.BASE_URL}`} element={ }>
{Routedata.map((idx: any) => (
<
Route key={idx.id} path={idx.path} element={idx.element} />
))}
<
/Route>
<
/Routes>
<
/BrowserRouter>
<
/HelmetProvider>
<
/Fragment>
);
Following are the fundamental building blocks to creating a new link.
├── src
├──components
├──layout-components
├──sidebar
├──nav.tsx
export const MENUITEMS: any = [
{
menutitle: "MAIN",
},
{ path: `${import.meta.env.BASE_URL}dashboard`, title: "Dashboard", icon: 'fe-home', type: "link", active: false, selected: false, dirchange: false },
]