-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
54 lines (47 loc) · 887 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React, { Children } from "react";
import {
createBrowserRouter,
RouterProvider,
Outlet
} from "react-router-dom";
import "./App.css";
import Home from "./pages/Home"
import About from "./pages/About"
import Products from "./pages/Products"
import ErrorPage from "./pages/ErrorPage";
import Navbar from "./components/Navbar";
import "./App.css"
const AppLayout = () => (
<>
<Navbar />
<Outlet />
</>
)
const router = createBrowserRouter([
{
element: <AppLayout />,
errorElement: <ErrorPage />,
children: [
{
path: "/",
element: <Home />,
},
{
path: "/about",
element: <About />
},
{
path: "/products",
element: <Products />
},
]
}
]);
function App() {
return (
<div>
<RouterProvider router={router} />
</div>
);
}
export default App;