title: React list choosing option
body: <p>I have an location app which can save name of locations.
  I am trying to get each saved location a red border by clicking on it.
  What it does is changing the border color of all the categories.
  How can I apply that?</p>
  
  <pre><code>class Categories extends Component {
      constructor(props) {
          super(props);
          this.state = {
              term: '',
              categories: [],
              selectedCategories: [],
              hidden: true,
              checkboxState: true
          };
      }
      toggle(e) {
          this.setState({
              checkboxState: !this.state.checkboxState
          })
      }
      onChange = (event) =&gt; {
          this.setState({ term: event.target.value });
      }
      addCategory = (event) =&gt; {
          if (this.state.term === '') {
              alert('Please name your category!')
          } else {
              event.preventDefault();
              this.setState({
                  term: '',
                  categories: [...this.state.categories, this.state.term]
              });
          }
      }
  
      render() {
          return (
              &lt;div className="categories"&gt;
                  &lt;h1&gt;Categories&lt;/h1&gt;
                  &lt;div className='actions'&gt;
                      &lt;button className="delete" onClick={this.deleteCategory}&gt;Delete&lt;/button&gt;
                      &lt;button className="edit" onClick={this.editCategory}&gt;Edit&lt;/button&gt;
  
                  &lt;/div&gt;
                  &lt;p&gt;To add new category, please enter category name&lt;/p&gt;
                  &lt;form className="App" onSubmit={this.addCategory}&gt;
                      &lt;input value={this.state.term} onChange={this.onChange} /&gt;
                      &lt;button&gt;Add&lt;/button&gt;
                  &lt;/form&gt;
  
                  {this.state.categories.map((category, index) =&gt;
                      &lt;button
                          key={index}
                          style={this.state.checkboxState ? { borderColor: '' } : { borderColor: 'red' }}
                          checked={this.state.isChecked}
                          onClick={this.toggle.bind(this)}&gt;
                          {category}&lt;/button&gt;
                  )}
              &lt;/div &gt;
          );
      }
  }
  </code></pre>
  
  <p>I want to be able to control each selected category seperatly, to be able to delete and edit theme as well.</p>