Skip to content

Commit

Permalink
fix react router
Browse files Browse the repository at this point in the history
  • Loading branch information
p6te committed Nov 10, 2023
1 parent f1462d8 commit f053385
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,41 @@ function App() {
);
};

const router = createBrowserRouter([
{
path: "/",
element: <Layout />,
children: [
{
path: "/",
element: <Home />,
},
{
path: "/users",
element: <Users />,
},
{
path: "/users/:id",
element: <User />,
},
{
path: "/products",
element: <Products />,
},
{
path: "/products/:id",
element: <Product />,
},
],
},
{
path: "/login",
element: <Login />,
},
]);
const router = createBrowserRouter(
[
{
path: "/",
element: <Layout />,
children: [
{
path: "/",
element: <Home />,
},
{
path: "/users",
element: <Users />,
},
{
path: "/users/:id",
element: <User />,
},
{
path: "/products",
element: <Products />,
},
{
path: "/products/:id",
element: <Product />,
},
],
},
{
path: "/login",
element: <Login />,
},
],
{ basename: import.meta.env.DEV ? "/" : "/admin-dashboard/" }
);
return <RouterProvider router={router} />;
}

Expand Down

0 comments on commit f053385

Please sign in to comment.