-
-
Save virtual/85aa283fdc5b3da7551624f66cb8bff5 to your computer and use it in GitHub Desktop.
Reactstrap App.js Example for create-react-app
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, { Component } from 'react'; | |
| import { | |
| Collapse, | |
| Navbar, | |
| NavbarToggler, | |
| NavbarBrand, | |
| Nav, | |
| NavItem, | |
| NavLink, | |
| Container, | |
| Row, | |
| Col, | |
| Jumbotron, | |
| Button | |
| } from 'reactstrap'; | |
| class App extends Component { | |
| constructor(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="dark" inverse toggleable> | |
| <NavbarToggler right onClick={this.toggle} /> | |
| <NavbarBrand href="/">reactstrap</NavbarBrand> | |
| <Collapse isOpen={this.state.isOpen} navbar> | |
| <Nav className="ml-auto" navbar> | |
| <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