-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.jsx
More file actions
37 lines (33 loc) · 1.01 KB
/
App.jsx
File metadata and controls
37 lines (33 loc) · 1.01 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
import { lazy, Suspense } from 'react'
import { createBrowserRouter } from 'react-router'
import { RouterProvider } from 'react-router/dom'
import { About, Footer, Home, Loading, Navbar, Uses } from './components'
const Articles = lazy(() =>
import('./components').then(module => ({ default: module.Articles }))
)
const Contact = lazy(() =>
import('./components').then(module => ({ default: module.Contact }))
)
const Work = lazy(() =>
import('./components').then(module => ({ default: module.Work }))
)
const router = createBrowserRouter([
{
path: '/',
element: <Navbar />,
children: [
{ path: '/', element: <Home /> },
{ path: '/about', element: <About /> },
{ path: '/work', element: <Work /> },
{ path: '/articles', element: <Articles /> },
{ path: '/uses', element: <Uses /> },
{ path: '/contact', element: <Contact /> },
],
},
])
export const App = () => (
<Suspense fallback={<Loading />}>
<RouterProvider router={router} />
<Footer />
</Suspense>
)