Advertisement
xcage88

App

May 21st, 2023
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Home from './page/Home'
  2. import Detail from './page/Detail'
  3. import Checkout from './page/Checkout'
  4. import InstruksiBayar from './page/InstruksiBayar'
  5. import { createBrowserRouter, RouterProvider,Outlet } from 'react-router-dom'
  6.  
  7. function App() {
  8.  
  9.   const route = createBrowserRouter([
  10.     {
  11.       path: '/',
  12.       children: [
  13.         {
  14.           index: true,
  15.           element: <Home/>
  16.         },
  17.         {
  18.           path: 'detail/:id',
  19.           element: <Detail/>
  20.         },
  21.         {
  22.           path: 'checkout/:id',
  23.           element: <Checkout/>
  24.         },
  25.         {
  26.           path: 'instruksi-bayar',
  27.           element: <InstruksiBayar/>
  28.         }
  29.       ]
  30.     }
  31.   ])
  32.  
  33.   return (
  34.     <>
  35.       <RouterProvider router={route}/>
  36.       <Outlet/>
  37.       {/* <Home /> */}
  38.       {/* <Detail/> */}
  39.       {/* <Checkout/> */}
  40.       {/* <InstruksiBayar/> */}
  41.     </>
  42.   )
  43. }
  44.  
  45. export default App
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement