const React = require("react"); const InfoButton = exports.InfoButton = React.createClass({ getInitialState() { return { open: false }; }, toggleOpen(e) { e.preventDefault(); this.setState({ open: !this.state.open }); }, chevron() { if (this.state.open) { return ; } else { return ; } }, render() { const open = this.state.open; let componentClass = ["treeview"]; let dropdown; if (open) { componentClass.push("active"); dropdown = ( ); } return (
  • Info {this.chevron()} {dropdown}
  • ); } });