Skip to content

Commit

Permalink
webapp: use createBrowserRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
inciner8r committed Mar 28, 2024
1 parent 15dd265 commit 4e50e60
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,47 @@
// App.tsx
import { BrowserRouter, Route, Routes } from "react-router-dom";
import {
createBrowserRouter,
BrowserRouter,
Route,
Routes,
RouterProvider,
} from "react-router-dom";
import Dashboard from "./pages/Dashboard";
import LandingPage from "./pages/LandingPage";
import Server from "./pages/Server";
import AuthComponent from "./components/Auth";

const App = () => {
const router = createBrowserRouter([
{
path: "/",
element: <LandingPage />,
},
{
path: "/auth",
element: <AuthComponent />,
},
{
path: "/dashboard",
element: <Dashboard />,
},
{
path: "/server",
element: <Server />,
},
]);
return (
<BrowserRouter>
<div>
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/auth" element={<AuthComponent />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/server" element={<Server />} />
</Routes>
</div>
</BrowserRouter>
<RouterProvider router={router} />
// <BrowserRouter>
// <div>
// <Routes>
// <Route path="/" element={<LandingPage />} />
// <Route path="/auth" element={<AuthComponent />} />
// <Route path="/dashboard" element={<Dashboard />} />
// <Route path="/server" element={<Server />} />
// </Routes>
// </div>
// </BrowserRouter>
);
};

Expand Down

0 comments on commit 4e50e60

Please sign in to comment.