title: How to set selected item in reactstrap Dropdown?
body: <p>How to set selected item in reactstrap Dropdown?</p>
  
  <p>There is example of dropdown: <a href="https://reactstrap.github.io/components/dropdowns/" rel="noreferrer">https://reactstrap.github.io/components/dropdowns/</a></p>
  
  <p>When I select item in dropdown, it is not displayed.</p>
  
  <p>*******************Working solution*****************************</p>
  
  <pre class="lang-js prettyprint-override"><code>import React from "react";
  import {ButtonDropdown, DropdownItem, DropdownMenu, DropdownToggle} from "reactstrap";
  import superagent from "superagent";
  
  class BootstrapSelect extends React.Component {
  
      constructor(props) {
          super(props);
  
          this.toggle = this.toggle.bind(this);
          this.changeValue = this.changeValue.bind(this);
          this.state = {
              actions: [],
              dropDownValue: 'Select action',
              dropdownOpen: false
          };
      }
  
      toggle(event) {
  
          this.setState({
              dropdownOpen: !this.state.dropdownOpen
          });
      }
  
      changeValue(e) {
          this.setState({dropDownValue: e.currentTarget.textContent});
          let id = e.currentTarget.getAttribute("id");
          console.log(id);
      }
  
  
      componentDidMount() {
          superagent
              .get('/getActions')
              .type('application/json; charset=utf-8')
              .end(function (err, res) {
                  console.log(res.body);
                  this.setState({actions: res.body});
              }.bind(this));
  
      }
  
      render() {
          return (
              &lt;ButtonDropdown isOpen={this.state.dropdownOpen} toggle={this.toggle}&gt;
                  &lt;DropdownToggle caret&gt;
                      {this.state.dropDownValue}
                  &lt;/DropdownToggle&gt;
                  &lt;DropdownMenu&gt;
                      {this.state.actions.map(e =&gt; {
                          return &lt;DropdownItem id={e.id} key={e.id} onClick={this.changeValue}&gt;{e.name}&lt;/DropdownItem&gt;
                      })}
                  &lt;/DropdownMenu&gt;
  
              &lt;/ButtonDropdown&gt;
          );
      }
  
  }
  
  export default BootstrapSelect;
  </code></pre>