Created
February 13, 2020 20:29
-
-
Save sonOfRa/47f6fdc20c87f2c4f1fd500092ba5286 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 {HashRouter as Router, Route, Switch, NavLink as RNavLink} from "react-router-dom"; | |
import {AllUsers} from "./User/AllUsers"; | |
import {Container, Navbar, NavbarBrand, Nav, NavItem, NavLink} from "reactstrap"; | |
class Index extends React.Component { | |
render() { | |
return <h2>Home</h2>; | |
} | |
} | |
class App extends React.Component { | |
render() { | |
return ( | |
<Container> | |
<Router> | |
<Navbar color={"light"} light={true} expand={"md"}> | |
<NavbarBrand href={"/"}>I'm a brand</NavbarBrand> | |
<Nav className={"mr-auto"} navbar={true}> | |
<NavItem> | |
<NavLink tag={RNavLink} exact to={"/"} activeClassName={"active"}>Index</NavLink> | |
</NavItem> | |
<NavItem> | |
<NavLink tag={RNavLink} to={"/users"} activeClassName={"active"}>Users</NavLink> | |
</NavItem> | |
</Nav> | |
</Navbar> | |
<Switch> | |
<Route path="/" exact component={Index}/> | |
<Route path="/users" component={AllUsers}/> | |
</Switch> | |
</Router> | |
</Container> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment