App.js 759 Bytes
Newer Older
김민수's avatar
김민수 committed
1
2
3
4
5
import React from 'react';
import './App.css';
import Home from './Home'
import Quiz from './Quiz'
import End from './End'
김민수's avatar
김민수 committed
6
import Admin from './Admin'
김민수's avatar
김민수 committed
7

김민수's avatar
김민수 committed
8
import { BrowserRouter as Router, Link, Switch, Route, Redirect } from 'react-router-dom';
김민수's avatar
김민수 committed
9
10
11
12
13
14

function App() {
  return (
    <Router>
      <header>
        <Link to="/">
김민수's avatar
수정2    
김민수 committed
15
          <button>Calculus</button>
김민수's avatar
김민수 committed
16
17
        </Link>
      </header>
김민수's avatar
김민수 committed
18
      <hr />
김민수's avatar
김민수 committed
19
20
      <div>
        <Switch>
김민수's avatar
김민수 committed
21
22
23
24
25
26
27
28
29
          <Route exact path="/" component={Home} />

          <Route path="/quiz" component={Quiz} />

          <Route path="/end" component={End} />

          <Route path="/admin" component={Admin} />

          <Redirect path="/admin" to="/admin" />
김민수's avatar
김민수 committed
30
31
32
33
34
35
36
37
        </Switch>
      </div>
    </Router>
  )
}


export default App;