-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.jsx
More file actions
33 lines (30 loc) · 802 Bytes
/
index.jsx
File metadata and controls
33 lines (30 loc) · 802 Bytes
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
import { createRoot } from "react-dom/client";
import App from './App.jsx';
import { createBrowserRouter, RouterProvider } from "react-router";
import Contact from "./components/Contact.jsx";
import Home from "./components/Home.jsx";
import Error from "./components/Error.jsx";
import CountryDetail from "./components/CountryDetail.jsx";
const router = createBrowserRouter([
{
path: '/',
element: <App />,
errorElement: <Error />,
children: [
{
path: '/',
element: <Home />,
},
{
path: '/contact',
element: <Contact />,
},
{
path: '/:country',
element: <CountryDetail />,
},
],
},
])
const root = createRoot(document.querySelector('#root'))
root.render(<RouterProvider router={router} />)