-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
54 lines (51 loc) · 1.33 KB
/
index.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
53
54
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import reportWebVitals from './reportWebVitals';
import { createBrowserRouter, RouterProvider} from 'react-router-dom';
import About from './About.js';
import Contact from './Contact.js';
import Error from './Error.js';
import Body from './Body.js';
import RestaurantMenu from './RestaurantMenu.js';
import Grocery from './Grocery.js'
import Applayout from './App.js';
const appRouter=createBrowserRouter([
{
path:"/",
element:<Applayout/>,
children:[
{
path:"/",
element:<Body/>,
},
{
path:"/about",
element:<About/>,
},
{
path:"/contact",
element:<Contact/>,
},
{
path:"/grocery",
element:<Grocery/>,
},
{
path:"restaurant/:resId",
element:<RestaurantMenu/>,
}
],
errorElement:<Error/>
}
]);
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<RouterProvider router={appRouter}/>
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();