-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathApp.js
More file actions
39 lines (34 loc) · 1.07 KB
/
Copy pathApp.js
File metadata and controls
39 lines (34 loc) · 1.07 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
import React from 'react';
import {BrowserRouter as Router, Route, Link, Switch} from 'react-router-dom';
import './App.css';
import Home from './pages/home';
import Content from './pages/content';
import PragueImage from './pages/prague-image';
// Exercise 1
//
// Rewrite this component so that it uses lazy() and Suspense for code splitting
// Display the Spinner from './components/spinner' until the lazy loaded components are ready
//
// 10 minutes, then we will do it together
// Check the "network" in developer tools when done
const App = () => (
<Router>
<div className="App">
<nav>
<ul>
<li><Link to="/">Home</Link></li>
<li><Link to="/content">Content</Link></li>
<li><Link to="/image">Image</Link></li>
</ul>
</nav>
<div className="App-content">
<Switch>
<Route path="/" exact component={Home} />
<Route path="/content" component={Content} />
<Route path="/image" component={PragueImage} />
</Switch>
</div>
</div>
</Router>
);
export default App;