-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.tsx
39 lines (35 loc) · 908 Bytes
/
app.tsx
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
import React, { FunctionComponent } from 'react'
import { Switch, Route, Link } from 'react-router-dom'
import loadable from '@loadable/component'
/**
* TODO:
* - `webpackChunkName` comment does not work, needs further investigation.
* - test https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/dynamic-import-chunkname.md
*/
const Home = loadable(() => import('./pages/home'))
const About = loadable(() => import('./pages/about'))
const App: FunctionComponent = () => {
return (
<div>
<nav>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/about">About</Link>
</li>
</ul>
</nav>
<Switch>
<Route path="/about">
<About />
</Route>
<Route path="/">
<Home />
</Route>
</Switch>
</div>
)
}
export default App