Commit 199db9ee authored by 김민수's avatar 김민수
Browse files

No commit message

No commit message
parent 41108b12
import React from 'react';
import logo from './logo.svg';
import './App.css';
import Home from './Home'
import Quiz from './Quiz'
import End from './End'
import { BrowserRouter as Router, Link, Switch, Route } from 'react-router-dom';
function App() {
return (
<div className="App">
<h2>어떤 페이지가 나올까요? ^ ^</h2>
궁금합니다^ ^
<Router>
<header>
<Link to="/">
<button>Calculus</button>
</Link>
</header>
<hr/>
<div>
<Switch>
<Route exact path="/">
<Home/>
</Route>
<Route path="/quiz">
<Quiz/>
</Route>
<Route path="/end">
<End/>
</Route>
</Switch>
</div>
);
</Router>
)
}
export default App;
\ No newline at end of file
import React from 'react'
import { Link } from 'react-router-dom';
function Home() {
state = {
value: ""
}
return (
<div className="Box">
<div className="Name">
이름을 입력하세요
<input onChange={(event) => {
console.log(event.target.value)
this.setState({
value : event.target.value
})
}}/>
}
}/>
</div>
{( this.state.value === null)
? alert('이름을 입력하세요')
: <Link to="/quiz">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment