Browse Source

write route code on App for home, create-ballot and 404 views

pull/4/head
Clement G 3 years ago
committed by guhur
parent
commit
c7e5594a61
  1. 23
      src/App.js

23
src/App.js

@ -1,9 +1,30 @@
import React from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import './App.css';
import Home from "./components/views/Home.js";
import CreateBallot from "./components/views/CreateBallot.js";
import UnknownView from "./components/views/UnknownView";
function App() {
return (
<div></div>
<Router>
<div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/create-ballot">Créer un vote</Link>
</li>
</ul>
<hr />
<Route exact path="/" component={Home} />
<Route path="/create-ballot" component={CreateBallot} />
<Route component={UnknownView} />
</div>
</Router>
);
}

Loading…
Cancel
Save