App.js 679 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
2
import React from 'react';
import './App.css';
Jiwon Yoon's avatar
Jiwon Yoon committed
3
4
5
6
7
import Home from './Home'
import Quiz from './Quiz'
import End from './End'

import { BrowserRouter as Router, Link, Switch, Route } from 'react-router-dom';
Yoon, Daeki's avatar
Yoon, Daeki committed
8
9
10

function App() {
  return (
Jiwon Yoon's avatar
Jiwon Yoon committed
11
12
13
14
15
16
    <Router>
      <header>
        <Link to="/">
          <button>Calculus</button>
        </Link>
      </header>
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
17
      <hr />
Jiwon Yoon's avatar
Jiwon Yoon committed
18
19
20
      <div>
        <Switch>
          <Route exact path="/">
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
21
            <Home />
Jiwon Yoon's avatar
Jiwon Yoon committed
22
23
          </Route>
          <Route path="/quiz">
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
24
            <Quiz />
Jiwon Yoon's avatar
Jiwon Yoon committed
25
26
          </Route>
          <Route path="/end">
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
27
            <End />
Jiwon Yoon's avatar
Jiwon Yoon committed
28
29
30
31
32
          </Route>
        </Switch>
      </div>
    </Router>
  )
Yoon, Daeki's avatar
Yoon, Daeki committed
33
34
}

Jiwon Yoon's avatar
quiz    
Jiwon Yoon committed
35

Jiwon Yoon's avatar
Jiwon Yoon committed
36
export default App;