-
-
Save amandeepmittal/1937fde45150e0bec1308dff2244eb47 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, NavLink } from "react-router-dom" | |
import Home from "./components/Home" | |
import About from "./components/About" | |
function App() { | |
return ( | |
<Router> | |
<div> | |
<nav style={{ margin: 10 }}> | |
<NavLink to='/' style={{ padding: 10 }}> | |
Home | |
</NavLink> | |
<NavLink to='/about' style={{ padding: 10 }}> | |
About | |
</NavLink> | |
</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