Created
September 24, 2020 01:53
-
-
Save wschenkel/6af1b813d51e51422424c6bb7407f5c1 to your computer and use it in GitHub Desktop.
React-router-dom
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 } from 'react-router-dom'; | |
import Header from './components/Header'; | |
import Reponame from './pages/Reponame'; | |
import Profile from './pages/Profile'; | |
function App() { | |
return ( | |
<Router> | |
<Header /> | |
<Switch> | |
<Route exact path="/"> | |
<Profile /> | |
</Route> | |
<Route exact path="/:username"> | |
<Profile /> | |
</Route> | |
<Route path="/:username/:reponame"> | |
<Reponame /> | |
</Route> | |
</Switch> | |
{/* <Footer /> */} | |
</Router> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment