-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.jsx
More file actions
52 lines (45 loc) · 1.22 KB
/
Copy pathmain.jsx
File metadata and controls
52 lines (45 loc) · 1.22 KB
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
import { createBrowserRouter , RouterProvider} from 'react-router-dom'
import { createRoot } from 'react-dom/client'
import App from './App.jsx'
import Contact from './Components/Contact.jsx';
import Body from './Components/body/Body.jsx';
import About from './Components/About.jsx';
import MenuCard from './Components/MenuCard.jsx';
import ErrorPage from './Components/ErrorPage.jsx';
import Cart from './Components/body/Cart.jsx';
import OrderPlaced from './Components/OrderPlaced.jsx';
const appRouter = createBrowserRouter([
{path : "/",
element: <App/>,
errorElement : <ErrorPage/>,
children : [
{
path : "/",
element : <Body/>
},
{
path : "/contact",
element : <Contact/>
},
{
path : "/about",
element : <About/>
},
{
path : "/restaurant/:resId",
element : <MenuCard/>
},
{
path : "/cart",
element : <Cart/>
},
{
path : "/order",
element : <OrderPlaced/>
},
]
}
]);
createRoot(document.getElementById('root')).render(
<RouterProvider router = {appRouter}/>
)