Following are the fundamental building blocks to creating a route.
main.tsx
into App.tsx
and add it
to the imports array.
import React, { Fragment} from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
//component import
import Dashboard from '../Dashboard/Dashboard';
import Accordians from './components/elements/Accordians/Accordians';
const container: HTMLElement | null = document.getElementById('root');
const root = createRoot(container!);
root.render(
<
Fragment>
<
BrowserRouter>
<
Routes>
//Home page
<
Route path={`${import.meta.env.BASE_URL}/`} element={ }>
<
Route index element={ } />
<
Route path={`${import.meta.env.BASE_URL}`} element={ } />
<
/Route>
<
/Routes>
<
/BrowserRouter>
<
/Fragment>
);
Following are the fundamental building blocks to creating a new link.
├── src
├──layouts
├──Sidebar
├──SidebarData.tsx
Ex: {
menutitle: "MAINITEMS",
Items: [
{ path: `${import.meta.env.BASE_URL}/Dashboard`, icon: 'fe fe-home', type: 'link', active: true, title: 'Dashboard' },
]
},