bereaksi router dom v6
import {BrowserRouter,Routes,Route,Navigate,Outlet} from "react-router-dom";
<BrowserRouter>
<Routes>
<Route path="/" element={<Navigate to="/main" />} />
<Route path="/home/*" element={<div><Outlet/></div>}>
<Route path="page1" element={<h1>home page 1</h1>} />
<Route path="page2" element={<h1>home page 2</h1>} />
</Route>
<Route path="/notification" element={<h1>notification page</h1>} />
<Route path="/notification/:id" element={<h1>notification details pages</h1>} />
<Route path="/login" element={<h1> login page </h1>} />
</Routes>
</BrowserRouter>
CodePadding