Created
November 18, 2017 09:34
-
-
Save krystofbe/47c19f41949249bb9b58af46794f1955 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
import * as React from "react"; | |
import { | |
Button, | |
Col, | |
Collapse, | |
Container, | |
Jumbotron, | |
Nav, | |
Navbar, | |
NavbarBrand, | |
NavbarToggler, | |
NavItem, | |
NavLink, | |
Row, | |
} from "reactstrap"; | |
import "./App.css"; | |
import "bootstrap/dist/css/bootstrap.css"; | |
type Props = {}; | |
type State = { | |
isOpen: boolean; | |
}; | |
class App extends React.Component<Props, State> { | |
constructor(props: Props) { | |
super(props); | |
this.toggle = this.toggle.bind(this); | |
this.state = { | |
isOpen: false, | |
}; | |
} | |
toggle() { | |
this.setState({ | |
isOpen: !this.state.isOpen, | |
}); | |
} | |
render() { | |
return ( | |
<div> | |
<Navbar color="faded" light={true} expand="md"> | |
<NavbarBrand href="/">reactstrap</NavbarBrand> | |
<NavbarToggler onClick={this.toggle} /> | |
<Collapse isOpen={this.state.isOpen} navbar={true}> | |
<Nav className="ml-auto" navbar={true}> | |
<NavItem> | |
<NavLink href="/components/">Components</NavLink> | |
</NavItem> | |
<NavItem> | |
<NavLink href="https://github.com/reactstrap/reactstrap"> | |
Github | |
</NavLink> | |
</NavItem> | |
</Nav> | |
</Collapse> | |
</Navbar> | |
<Jumbotron> | |
<Container> | |
<Row> | |
<Col> | |
<h1>Welcome to React</h1> | |
<p> | |
<Button | |
tag="a" | |
color="success" | |
size="large" | |
href="http://reactstrap.github.io" | |
target="_blank" | |
> | |
View Reactstrap Docs | |
</Button> | |
</p> | |
</Col> | |
</Row> | |
</Container> | |
</Jumbotron> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is working great for me now in 2020, and I am using
"react": "^16.12.0",
and"reactstrap": "^8.4.1",
.