Skip to content

Instantly share code, notes, and snippets.

@stivncastillo
Last active August 8, 2021 20:27
Show Gist options
  • Save stivncastillo/d6028d831fc9a647551eff8c975f7eb5 to your computer and use it in GitHub Desktop.
Save stivncastillo/d6028d831fc9a647551eff8c975f7eb5 to your computer and use it in GitHub Desktop.
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