-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
45 lines (40 loc) · 1017 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
import React from "react";
import ReactDOM from "react-dom/client";
import Header from "./src/components/Header";
import Body from "./src/components/Body";
import Footer from "./src/components/Footer";
import About from "./src/components/About";
import { Outlet, RouterProvider, createBrowserRouter } from "react-router-dom";
import Error from "./src/components/Error";
const App = () => {
return (
<div className="app h-screen w-screen dark:bg-black">
<Header />
<Outlet className="dark:bg-black" />
<Footer />
</div>
);
};
const appRouter = createBrowserRouter([
{
path: "/",
element: <App />,
errorElement: <Error />,
children: [
{
path: "/",
element: <Body />,
},
{
path: "/about",
element: <About />,
},
{
path: "*",
element: <Error />,
},
],
},
]);
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<RouterProvider router={appRouter} />);