Last active
August 8, 2021 20:27
-
-
Save stivncastillo/d6028d831fc9a647551eff8c975f7eb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { | |
BrowserRouter as Router, | |
Switch, | |
Route, | |
Link | |
} from "react-router-dom"; | |
// pages | |
import LoginPage from './pages/LoginPage' | |
import DashboardPage from './pages/DashboardPage' | |
import ProfilePage from './pages/ProfilePage' | |
function App() { | |
return ( | |
<Router> | |
<div> | |
<nav> | |
<ul> | |
<li> | |
<Link to="/">Dashboard</Link> | |
</li> | |
<li> | |
<Link to="/login">Login</Link> | |
</li> | |
<li> | |
<Link to="/profile">Profile</Link> | |
</li> | |
</ul> | |
</nav> | |
<Switch> | |
<Route path="/login"> | |
<LoginPage /> | |
</Route> | |
<Route path="/profile"> | |
<ProfilePage /> | |
</Route> | |
<Route path="/"> | |
<DashboardPage /> | |
</Route> | |
</Switch> | |
</div> | |
</Router> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment