-
-
Save amandeepmittal/5fd106701a6e63cf33b5eca4c60ee28d 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
// App.js | |
import React from "react" | |
import { BrowserRouter as Router, Route, Link } from "react-router-dom" | |
import Home from "./components/Home" | |
import About from "./components/About" | |
function App() { | |
return ( | |
<Router> | |
<div> | |
<nav style={{ margin: 10 }}> | |
<Link to='/' style={{ padding: 10 }}> | |
Home | |
</Link> | |
<Link to='/about' style={{ padding: 10 }}> | |
About | |
</Link> | |
</nav> | |
<Route path='/' exact component={Home} /> | |
<Route path='/about' component={About} /> | |
</div> | |
</Router> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment