-
-
Save amandeepmittal/2ab576a5e68a1b93dd55d08b8266fc4c 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 Posts from "./components/Posts" | |
function App() { | |
return ( | |
<Router> | |
<div> | |
<nav style={{ margin: 10 }}> | |
<NavLink to='/' exact activeClassName='active'> | |
Home | |
</NavLink> | |
<NavLink to='/about' activeClassName='active'> | |
About | |
</NavLink> | |
<NavLink to='/posts' activeClassName='active'> | |
Posts | |
</NavLink> | |
</nav> | |
<Route path='/' exact component={Home} /> | |
<Route path='/about' component={About} /> | |
<Route path='/posts' component={Posts} /> | |
</div> | |
</Router> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment