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

7
import { BrowserRouter as Router, Link, Switch, Route } from 'react-router-dom';
JeongYeonwoo's avatar
JeongYeonwoo committed
8

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

Yoon, Daeki's avatar
Yoon, Daeki committed
35

36
export default App;