Skip to content

Instantly share code, notes, and snippets.

@krystofbe
Created November 18, 2017 09:34
Show Gist options
  • Save krystofbe/47c19f41949249bb9b58af46794f1955 to your computer and use it in GitHub Desktop.
Save krystofbe/47c19f41949249bb9b58af46794f1955 to your computer and use it in GitHub Desktop.
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;
@laubonghaudoi
Copy link

This is working great for me now in 2020, and I am using "react": "^16.12.0", and "reactstrap": "^8.4.1",.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment