Skip to content

Instantly share code, notes, and snippets.

@wschenkel
Created September 24, 2020 01:53
Show Gist options
  • Save wschenkel/6af1b813d51e51422424c6bb7407f5c1 to your computer and use it in GitHub Desktop.
Save wschenkel/6af1b813d51e51422424c6bb7407f5c1 to your computer and use it in GitHub Desktop.
React-router-dom
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